Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / cmake / modules / AddBOLT.cmake
blob1f69b9046320a775bd2e3b04c2a95a27058cf902
1 include(GNUInstallDirs)
2 include(LLVMDistributionSupport)
4 macro(add_bolt_executable name)
5   add_llvm_executable(${name} ${ARGN})
6   set_target_properties(${name} PROPERTIES FOLDER "BOLT")
7 endmacro()
9 macro(add_bolt_tool name)
10   if (NOT BOLT_BUILD_TOOLS)
11     set(EXCLUDE_FROM_ALL ON)
12   endif()
14   add_bolt_executable(${name} ${ARGN})
16   if (BOLT_BUILD_TOOLS)
17     get_target_export_arg(${name} BOLT export_to_bolttargets)
18     install(TARGETS ${name}
19       ${export_to_bolttargets}
20       RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
21       COMPONENT bolt)
23     if(NOT LLVM_ENABLE_IDE)
24       add_llvm_install_targets(install-${name}
25                                DEPENDS ${name}
26                                COMPONENT bolt)
27     endif()
28     set_property(GLOBAL APPEND PROPERTY BOLT_EXPORTS ${name})
29   endif()
30 endmacro()
32 macro(add_bolt_tool_symlink name dest)
33   llvm_add_tool_symlink(BOLT ${name} ${dest} ALWAYS_GENERATE)
34   # Always generate install targets
35   llvm_install_symlink(BOLT ${name} ${dest} ALWAYS_GENERATE COMPONENT bolt)
36 endmacro()