//===---------------------------------------------------------------===
// opt command line tool
//===---------------------------------------------------------------===

cc_binary_host {
    name: "opt",
    defaults: ["llvm-defaults"],
    srcs: ["*.cpp"],
    static_libs: [
        "libLLVMIRReader",
        "libLLVMBitReader",
        "libLLVMBitWriter",
        "libLLVMARMCodeGen",
        "libLLVMARMInfo",
        "libLLVMARMDesc",
        "libLLVMARMAsmPrinter",
        "libLLVMARMDisassembler",
        "libLLVMAArch64CodeGen",
        "libLLVMAArch64Info",
        "libLLVMAArch64Desc",
        "libLLVMAArch64AsmPrinter",
        "libLLVMAArch64Utils",
        "libLLVMAArch64Disassembler",
        "libLLVMMipsCodeGen",
        "libLLVMMipsInfo",
        "libLLVMMipsDesc",
        "libLLVMMipsAsmPrinter",
        "libLLVMMipsDisassembler",
        "libLLVMX86CodeGen",
        "libLLVMX86Info",
        "libLLVMX86Desc",
        "libLLVMX86AsmPrinter",
        "libLLVMX86Utils",
        "libLLVMX86Disassembler",
        "libLLVMGlobalISel",
        "libLLVMAsmPrinter",
        "libLLVMDebugInfoCodeView",
        "libLLVMSelectionDAG",
        "libLLVMCodeGen",
        "libLLVMTransformObjCARC",
        "libLLVMVectorize",
        "libLLVMScalarOpts",
        "libLLVMPasses",
        "libLLVMipo",
        "libLLVMLinker",
        "libLLVMInstCombine",
        "libLLVMInstrumentation",
        "libLLVMTransformUtils",
        "libLLVMAnalysis",
        "libLLVMTarget",
        "libLLVMMC",
        "libLLVMMCParser",
        "libLLVMObject",
        "libLLVMProfileData",
        "libLLVMCore",
        "libLLVMAsmParser",
        "libLLVMOption",
        "libLLVMSupport",
        "libLLVMMCDisassembler",
    ],
    target: {
        darwin: {
            ldflags: ["-Wl,-export_dynamic"],
        },
        linux: {
            ldflags: ["-Wl,--export-dynamic"],
        },
    },
}