diff options
author | Petr Hosek <phosek@google.com> | 2023-05-26 22:11:24 +0000 |
---|---|---|
committer | Petr Hosek <phosek@google.com> | 2023-06-01 14:48:01 +0000 |
commit | f3269a94e729b02e9d7c07257c45b098506cca22 (patch) | |
tree | 7af087b1499d161a71c6df86d9d4a1cd0343d758 /bolt/tools | |
parent | 92901996a63b14c3a8605652735acdaf2c20eac9 (diff) | |
download | llvm-f3269a94e729b02e9d7c07257c45b098506cca22.zip llvm-f3269a94e729b02e9d7c07257c45b098506cca22.tar.gz llvm-f3269a94e729b02e9d7c07257c45b098506cca22.tar.bz2 |
[BOLT][CMake] Redo the build and install targets
The existing BOLT install targets are broken on Windows becase they
don't properly handle the output extension. We cannot use the existing
LLVM macros since those make assumptions that don't hold for BOLT. This
change instead implements custom macros following the approach used by
Clang and LLD.
Differential Revision: https://reviews.llvm.org/D151595
Diffstat (limited to 'bolt/tools')
-rw-r--r-- | bolt/tools/CMakeLists.txt | 10 | ||||
-rw-r--r-- | bolt/tools/bat-dump/CMakeLists.txt | 4 | ||||
-rw-r--r-- | bolt/tools/driver/CMakeLists.txt | 20 | ||||
-rw-r--r-- | bolt/tools/heatmap/CMakeLists.txt | 2 | ||||
-rw-r--r-- | bolt/tools/merge-fdata/CMakeLists.txt | 6 |
5 files changed, 4 insertions, 38 deletions
diff --git a/bolt/tools/CMakeLists.txt b/bolt/tools/CMakeLists.txt index 52050fb..22ea3b9 100644 --- a/bolt/tools/CMakeLists.txt +++ b/bolt/tools/CMakeLists.txt @@ -2,16 +2,6 @@ set(BOLT_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH "Path for binary subdirectory (defaults to '${CMAKE_INSTALL_BINDIR}')") mark_as_advanced(BOLT_TOOLS_INSTALL_DIR) -# Move these macros to AddBolt if such a CMake module is ever created. - -macro(add_bolt_tool name) - llvm_add_tool(BOLT ${ARGV}) -endmacro() - -macro(add_bolt_tool_symlink name) - llvm_add_tool_symlink(BOLT ${ARGV}) -endmacro() - add_subdirectory(driver) add_subdirectory(llvm-bolt-fuzzer) add_subdirectory(bat-dump) diff --git a/bolt/tools/bat-dump/CMakeLists.txt b/bolt/tools/bat-dump/CMakeLists.txt index 71d4f3e..037b7d2 100644 --- a/bolt/tools/bat-dump/CMakeLists.txt +++ b/bolt/tools/bat-dump/CMakeLists.txt @@ -3,7 +3,7 @@ set(LLVM_LINK_COMPONENTS Support ) -add_llvm_tool(llvm-bat-dump +add_bolt_executable(llvm-bat-dump bat-dump.cpp DISABLE_LLVM_LINK_LLVM_DYLIB @@ -13,5 +13,3 @@ target_link_libraries(llvm-bat-dump PRIVATE LLVMBOLTProfile ) - -set_target_properties(llvm-bat-dump PROPERTIES FOLDER "BOLT") diff --git a/bolt/tools/driver/CMakeLists.txt b/bolt/tools/driver/CMakeLists.txt index 1c59619..9bf9ff8 100644 --- a/bolt/tools/driver/CMakeLists.txt +++ b/bolt/tools/driver/CMakeLists.txt @@ -30,22 +30,6 @@ target_link_libraries(llvm-bolt add_bolt_tool_symlink(perf2bolt llvm-bolt) add_bolt_tool_symlink(llvm-boltdiff llvm-bolt) -set(BOLT_DEPENDS - llvm-bolt - perf2bolt - llvm-boltdiff - ) - -add_custom_target(bolt DEPENDS ${BOLT_DEPENDS}) -install(PROGRAMS - ${CMAKE_BINARY_DIR}/bin/llvm-bolt - ${CMAKE_BINARY_DIR}/bin/perf2bolt - ${CMAKE_BINARY_DIR}/bin/llvm-boltdiff - DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT bolt - ) -add_llvm_install_targets(install-bolt DEPENDS bolt COMPONENT bolt) -set_target_properties(bolt PROPERTIES FOLDER "BOLT") -set_target_properties(install-bolt PROPERTIES FOLDER "BOLT") +add_dependencies(bolt llvm-bolt) -include_directories( ${BOLT_SOURCE_DIR}/lib ) +include_directories(${BOLT_SOURCE_DIR}/lib) diff --git a/bolt/tools/heatmap/CMakeLists.txt b/bolt/tools/heatmap/CMakeLists.txt index 9f52ddb..acddc7a 100644 --- a/bolt/tools/heatmap/CMakeLists.txt +++ b/bolt/tools/heatmap/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(llvm-bolt-heatmap LLVMBOLTUtils ) -set_target_properties(llvm-bolt-heatmap PROPERTIES FOLDER "BOLT") +add_dependencies(bolt llvm-bolt-heatmap) diff --git a/bolt/tools/merge-fdata/CMakeLists.txt b/bolt/tools/merge-fdata/CMakeLists.txt index 9405acb..f6a87a2 100644 --- a/bolt/tools/merge-fdata/CMakeLists.txt +++ b/bolt/tools/merge-fdata/CMakeLists.txt @@ -8,14 +8,8 @@ add_bolt_tool(merge-fdata DEPENDS intrinsics_gen ) -set_target_properties(merge-fdata PROPERTIES FOLDER "BOLT") add_dependencies(bolt merge-fdata) -install(PROGRAMS - ${CMAKE_BINARY_DIR}/bin/merge-fdata - DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT bolt - ) # Emit relocations for BOLT meta test (bolt/test/runtime/meta-merge-fdata.test) if (BOLT_INCLUDE_TESTS AND UNIX AND NOT APPLE) |