1 get_property(LLVM_COMMON_DEPENDS GLOBAL PROPERTY LLVM_DRIVER_DEPS)
2 get_property(LLVM_DRIVER_OBJLIBS GLOBAL PROPERTY LLVM_DRIVER_OBJLIBS)
4 get_property(LLVM_DRIVER_TOOLS GLOBAL PROPERTY LLVM_DRIVER_TOOLS)
6 list(SORT LLVM_DRIVER_TOOLS)
7 list(REVERSE LLVM_DRIVER_TOOLS)
8 foreach(tool ${LLVM_DRIVER_TOOLS})
9 string(REPLACE "-" "_" tool_entry ${tool})
10 get_property(tool_aliases GLOBAL PROPERTY LLVM_DRIVER_TOOL_ALIASES_${tool})
11 foreach(alias ${tool_aliases})
12 set_property(GLOBAL APPEND PROPERTY LLVM_DRIVER_TOOL_SYMLINKS ${alias})
13 string(REPLACE "llvm-" "" alias ${alias})
14 set(def_decl "${def_decl}LLVM_DRIVER_TOOL(\"${alias}\", ${tool_entry})\n")
19 "${CMAKE_CURRENT_BINARY_DIR}/LLVMDriverTools.def"
20 "${def_decl}#undef LLVM_DRIVER_TOOL\n")
22 target_include_directories(llvm-driver PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
23 target_sources(llvm-driver PRIVATE llvm-driver.cpp)
25 set_target_properties(llvm-driver PROPERTIES OUTPUT_NAME llvm)
27 target_link_libraries(llvm-driver PUBLIC ${LLVM_DRIVER_OBJLIBS})
28 target_link_libraries(llvm-driver PUBLIC LLVMDebuginfod)
31 # dsymutil uses some CoreFoundation stuff on Darwin...
32 target_link_libraries(llvm-driver PRIVATE "-framework CoreFoundation")
35 macro(generate_driver_tool_targets)
36 get_property(LLVM_DRIVER_TOOL_SYMLINKS GLOBAL PROPERTY LLVM_DRIVER_TOOL_SYMLINKS)
37 foreach(name ${LLVM_DRIVER_TOOL_SYMLINKS})
38 add_llvm_tool_symlink(${name} llvm-driver ALWAYS_GENERATE)
39 # Always generate install targets
40 llvm_install_symlink(LLVM ${name} llvm-driver ALWAYS_GENERATE)