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")
16 get_property(hidden_tool_aliases GLOBAL PROPERTY LLVM_DRIVER_HIDDEN_TOOL_ALIASES_${tool})
17 foreach(alias ${hidden_tool_aliases})
18 string(REPLACE "llvm-" "" alias ${alias})
19 set(def_decl "${def_decl}LLVM_DRIVER_TOOL(\"${alias}\", ${tool_entry})\n")
24 "${CMAKE_CURRENT_BINARY_DIR}/LLVMDriverTools.def"
25 "${def_decl}#undef LLVM_DRIVER_TOOL\n")
27 target_include_directories(llvm-driver PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
28 target_sources(llvm-driver PRIVATE llvm-driver.cpp)
30 set_target_properties(llvm-driver PROPERTIES OUTPUT_NAME llvm)
32 target_link_libraries(llvm-driver PUBLIC ${LLVM_DRIVER_OBJLIBS})
33 target_link_libraries(llvm-driver PUBLIC LLVMDebuginfod)
36 # dsymutil uses some CoreFoundation stuff on Darwin...
37 target_link_libraries(llvm-driver PRIVATE "-framework CoreFoundation")
40 macro(generate_driver_tool_targets)
41 get_property(LLVM_DRIVER_TOOL_SYMLINKS GLOBAL PROPERTY LLVM_DRIVER_TOOL_SYMLINKS)
42 foreach(name ${LLVM_DRIVER_TOOL_SYMLINKS})
43 add_llvm_tool_symlink(${name} llvm-driver ALWAYS_GENERATE)
44 # Always generate install targets
45 llvm_install_symlink(LLVM ${name} llvm-driver ALWAYS_GENERATE)