[PATCH] D151595: [BOLT][CMake] Avoid duplicating standard install targets
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 30 15:18:12 PDT 2023
phosek updated this revision to Diff 526809.
phosek retitled this revision from "[BOLT][CMake] Use LLVM macros for install targets" to "[BOLT][CMake] Avoid duplicating standard install targets".
phosek edited the summary of this revision.
phosek added a comment.
I had to redo the patch after investigating the builder failure and better understanding the intention of the original code.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151595/new/
https://reviews.llvm.org/D151595
Files:
bolt/tools/CMakeLists.txt
bolt/tools/driver/CMakeLists.txt
bolt/tools/merge-fdata/CMakeLists.txt
Index: bolt/tools/merge-fdata/CMakeLists.txt
===================================================================
--- bolt/tools/merge-fdata/CMakeLists.txt
+++ bolt/tools/merge-fdata/CMakeLists.txt
@@ -11,11 +11,6 @@
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)
Index: bolt/tools/driver/CMakeLists.txt
===================================================================
--- bolt/tools/driver/CMakeLists.txt
+++ bolt/tools/driver/CMakeLists.txt
@@ -37,15 +37,19 @@
)
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")
+
+add_custom_target(install-bolt)
+add_custom_target(install-bolt-stripped)
+foreach(target ${BOLT_DEPENDS})
+ if(TARGET install-${target})
+ add_custom_target(install-bolt install-${target})
+ endif()
+ if(TARGET install-${target}-stripped)
+ add_custom_target(install-bolt-stripped install-${target})
+ endif()
+endforeach()
set_target_properties(install-bolt PROPERTIES FOLDER "BOLT")
+set_target_properties(install-bolt-stripped PROPERTIES FOLDER "BOLT")
include_directories( ${BOLT_SOURCE_DIR}/lib )
Index: bolt/tools/CMakeLists.txt
===================================================================
--- bolt/tools/CMakeLists.txt
+++ bolt/tools/CMakeLists.txt
@@ -8,8 +8,8 @@
llvm_add_tool(BOLT ${ARGV})
endmacro()
-macro(add_bolt_tool_symlink name)
- llvm_add_tool_symlink(BOLT ${ARGV})
+macro(add_bolt_tool_symlink name dest)
+ llvm_add_tool_symlink(BOLT ${name} ${dest})
endmacro()
add_subdirectory(driver)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151595.526809.patch
Type: text/x-patch
Size: 2083 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230530/6d0b9829/attachment.bin>
More information about the llvm-commits
mailing list