Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bolt
diff options
context:
space:
mode:
authorAmir Ayupov <aaupov@users.noreply.github.com>2022-05-13 23:14:45 +0300
committerAmir Ayupov <aaupov@fb.com>2022-05-13 23:27:21 +0300
commitbdba3d091c66e3ab87fe0d631d90771b747ddf0d (patch)
treee72f040402556f966e585f80d55121a88d41378f /bolt
parentf0792c715dc5c2dc34793f11b9e91de3efa48979 (diff)
[BOLT][CMAKE] Fix DYLIB build
Move BOLT libraries out of `LLVM_LINK_COMPONENTS` to `target_link_libraries`. Addresses issue #55432. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D125568
Diffstat (limited to 'bolt')
-rw-r--r--bolt/lib/Core/CMakeLists.txt6
-rw-r--r--bolt/lib/Passes/CMakeLists.txt8
-rw-r--r--bolt/lib/Profile/CMakeLists.txt10
-rw-r--r--bolt/lib/Rewrite/CMakeLists.txt22
-rw-r--r--bolt/lib/RuntimeLibs/CMakeLists.txt10
-rw-r--r--bolt/tools/driver/CMakeLists.txt10
-rw-r--r--bolt/tools/heatmap/CMakeLists.txt10
-rw-r--r--bolt/unittests/Core/CMakeLists.txt8
8 files changed, 60 insertions, 24 deletions
diff --git a/bolt/lib/Core/CMakeLists.txt b/bolt/lib/Core/CMakeLists.txt
index 9e576629d5e1..8184f25112b8 100644
--- a/bolt/lib/Core/CMakeLists.txt
+++ b/bolt/lib/Core/CMakeLists.txt
@@ -1,5 +1,4 @@
set(LLVM_LINK_COMPONENTS
- BOLTUtils
DebugInfoDWARF
Demangle
MC
@@ -26,3 +25,8 @@ add_llvm_library(LLVMBOLTCore
LINK_LIBS
${LLVM_PTHREAD_LIB}
)
+
+target_link_libraries(LLVMBOLTCore
+ PRIVATE
+ LLVMBOLTUtils
+ )
diff --git a/bolt/lib/Passes/CMakeLists.txt b/bolt/lib/Passes/CMakeLists.txt
index 95d872d0d168..bb296263bb4e 100644
--- a/bolt/lib/Passes/CMakeLists.txt
+++ b/bolt/lib/Passes/CMakeLists.txt
@@ -51,8 +51,12 @@ add_llvm_library(LLVMBOLTPasses
LINK_COMPONENTS
AsmPrinter
- BOLTCore
- BOLTUtils
MC
Support
)
+
+target_link_libraries(LLVMBOLTPasses
+ PRIVATE
+ LLVMBOLTCore
+ LLVMBOLTUtils
+ )
diff --git a/bolt/lib/Profile/CMakeLists.txt b/bolt/lib/Profile/CMakeLists.txt
index b1501968eb65..f4397e3314d6 100644
--- a/bolt/lib/Profile/CMakeLists.txt
+++ b/bolt/lib/Profile/CMakeLists.txt
@@ -8,8 +8,12 @@ add_llvm_library(LLVMBOLTProfile
YAMLProfileWriter.cpp
LINK_COMPONENTS
- BOLTCore
- BOLTPasses
- BOLTUtils
Support
)
+
+target_link_libraries(LLVMBOLTProfile
+ PRIVATE
+ LLVMBOLTCore
+ LLVMBOLTPasses
+ LLVMBOLTUtils
+ )
diff --git a/bolt/lib/Rewrite/CMakeLists.txt b/bolt/lib/Rewrite/CMakeLists.txt
index dfef547b5d33..053fa9ac15ea 100644
--- a/bolt/lib/Rewrite/CMakeLists.txt
+++ b/bolt/lib/Rewrite/CMakeLists.txt
@@ -1,9 +1,4 @@
set(LLVM_LINK_COMPONENTS
- BOLTCore
- BOLTPasses
- BOLTProfile
- BOLTRuntimeLibs
- BOLTUtils
DebugInfoDWARF
DWP
ExecutionEngine
@@ -12,13 +7,21 @@ set(LLVM_LINK_COMPONENTS
Support
)
+set(TARGET_LINK_LIBRARIES
+ LLVMBOLTCore
+ LLVMBOLTPasses
+ LLVMBOLTProfile
+ LLVMBOLTRuntimeLibs
+ LLVMBOLTUtils
+ )
+
if ("AArch64" IN_LIST LLVM_TARGETS_TO_BUILD)
- list(APPEND LLVM_LINK_COMPONENTS BOLTTargetAArch64)
+ list(APPEND TARGET_LINK_LIBRARIES LLVMBOLTTargetAArch64)
set(BOLT_AArch64 On)
endif()
if ("X86" IN_LIST LLVM_TARGETS_TO_BUILD)
- list(APPEND LLVM_LINK_COMPONENTS BOLTTargetX86)
+ list(APPEND TARGET_LINK_LIBRARIES LLVMBOLTTargetX86)
set(BOLT_X64 On)
endif()
@@ -34,6 +37,11 @@ add_llvm_library(LLVMBOLTRewrite
${LLVM_PTHREAD_LIB}
)
+target_link_libraries(LLVMBOLTRewrite
+ PRIVATE
+ ${TARGET_LINK_LIBRARIES}
+ )
+
if (DEFINED BOLT_AArch64)
target_compile_definitions(LLVMBOLTRewrite PRIVATE AARCH64_AVAILABLE)
endif()
diff --git a/bolt/lib/RuntimeLibs/CMakeLists.txt b/bolt/lib/RuntimeLibs/CMakeLists.txt
index a489fd2f198c..f0359a652d39 100644
--- a/bolt/lib/RuntimeLibs/CMakeLists.txt
+++ b/bolt/lib/RuntimeLibs/CMakeLists.txt
@@ -1,7 +1,4 @@
set(LLVM_LINK_COMPONENTS
- BOLTCore
- BOLTPasses
- BOLTUtils
BinaryFormat
MC
Object
@@ -14,3 +11,10 @@ add_llvm_library(LLVMBOLTRuntimeLibs
HugifyRuntimeLibrary.cpp
InstrumentationRuntimeLibrary.cpp
)
+
+target_link_libraries(LLVMBOLTRuntimeLibs
+ PRIVATE
+ LLVMBOLTCore
+ LLVMBOLTPasses
+ LLVMBOLTUtils
+ )
diff --git a/bolt/tools/driver/CMakeLists.txt b/bolt/tools/driver/CMakeLists.txt
index 462381bd791a..2338ccec11d2 100644
--- a/bolt/tools/driver/CMakeLists.txt
+++ b/bolt/tools/driver/CMakeLists.txt
@@ -1,8 +1,5 @@
set(LLVM_LINK_COMPONENTS
${LLVM_TARGETS_TO_BUILD}
- BOLTProfile
- BOLTRewrite
- BOLTUtils
MC
Object
Support
@@ -21,6 +18,13 @@ add_llvm_tool(llvm-bolt
${BOLT_DRIVER_DEPS}
)
+target_link_libraries(llvm-bolt
+ PRIVATE
+ LLVMBOLTProfile
+ LLVMBOLTRewrite
+ LLVMBOLTUtils
+ )
+
add_llvm_tool_symlink(perf2bolt llvm-bolt)
add_llvm_tool_symlink(llvm-boltdiff llvm-bolt)
diff --git a/bolt/tools/heatmap/CMakeLists.txt b/bolt/tools/heatmap/CMakeLists.txt
index 2a04704683f6..820b268125e8 100644
--- a/bolt/tools/heatmap/CMakeLists.txt
+++ b/bolt/tools/heatmap/CMakeLists.txt
@@ -1,8 +1,5 @@
set(LLVM_LINK_COMPONENTS
${LLVM_TARGETS_TO_BUILD}
- BOLTProfile
- BOLTRewrite
- BOLTUtils
MC
Object
Support
@@ -12,4 +9,11 @@ add_llvm_tool(llvm-bolt-heatmap
heatmap.cpp
)
+target_link_libraries(llvm-bolt-heatmap
+ PRIVATE
+ LLVMBOLTProfile
+ LLVMBOLTRewrite
+ LLVMBOLTUtils
+ )
+
set_target_properties(llvm-bolt-heatmap PROPERTIES FOLDER "BOLT")
diff --git a/bolt/unittests/Core/CMakeLists.txt b/bolt/unittests/Core/CMakeLists.txt
index 926e65b874ca..6e4538bb08fd 100644
--- a/bolt/unittests/Core/CMakeLists.txt
+++ b/bolt/unittests/Core/CMakeLists.txt
@@ -1,6 +1,4 @@
set(LLVM_LINK_COMPONENTS
- BOLTCore
- BOLTRewrite
DebugInfoDWARF
Object
MC
@@ -12,6 +10,12 @@ add_bolt_unittest(CoreTests
MCPlusBuilder.cpp
)
+target_link_libraries(CoreTests
+ PRIVATE
+ LLVMBOLTCore
+ LLVMBOLTRewrite
+ )
+
if ("AArch64" IN_LIST LLVM_TARGETS_TO_BUILD)
include_directories(
${LLVM_MAIN_SRC_DIR}/lib/Target/AArch64