summaryrefslogtreecommitdiff
path: root/bolt/unittests
diff options
context:
space:
mode:
authorAmir Ayupov <amir.aupov@gmail.com>2022-02-04 15:04:01 -0800
committerAmir Ayupov <amir.aupov@gmail.com>2022-02-04 18:01:15 -0800
commiteddf384965560f40b9d375b6e07f3b3db537a010 (patch)
tree87a3655a560c5d74adb4605565b2b16212af53c3 /bolt/unittests
parentb9d4fe87e1239dae5120930c2ebc9b50c9d81716 (diff)
downloadllvm-eddf384965560f40b9d375b6e07f3b3db537a010.tar.gz
[BOLT-UnitTests] Fix shared libraries build
Fix build with `-DBUILD_SHARED_LIBS=ON` (add explicit deps). Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D119042
Diffstat (limited to 'bolt/unittests')
-rw-r--r--bolt/unittests/Core/CMakeLists.txt14
1 files changed, 8 insertions, 6 deletions
diff --git a/bolt/unittests/Core/CMakeLists.txt b/bolt/unittests/Core/CMakeLists.txt
index 034831a54e67..1516eb4a6762 100644
--- a/bolt/unittests/Core/CMakeLists.txt
+++ b/bolt/unittests/Core/CMakeLists.txt
@@ -1,23 +1,25 @@
set(LLVM_LINK_COMPONENTS
+ BOLTCore
BOLTRewrite
+ DebugInfoDWARF
+ Object
+ ${LLVM_TARGETS_TO_BUILD}
)
add_bolt_unittest(CoreTests
MCPlusBuilder.cpp
)
-string(FIND "${LLVM_TARGETS_TO_BUILD}" "AArch64" POSITION)
-if (NOT ${POSITION} EQUAL -1)
+if ("AArch64" IN_LIST LLVM_TARGETS_TO_BUILD)
include_directories(
- ${CMAKE_SOURCE_DIR}/lib/Target/AArch64
- ${CMAKE_BINARY_DIR}/lib/Target/AArch64
+ ${LLVM_MAIN_SRC_DIR}/lib/Target/AArch64
+ ${LLVM_BINARY_DIR}/lib/Target/AArch64
)
target_compile_definitions(CoreTests PRIVATE AARCH64_AVAILABLE)
endif()
-string(FIND "${LLVM_TARGETS_TO_BUILD}" "X86" POSITION)
-if (NOT ${POSITION} EQUAL -1)
+if ("X86" IN_LIST LLVM_TARGETS_TO_BUILD)
include_directories(
${LLVM_MAIN_SRC_DIR}/lib/Target/X86
${LLVM_BINARY_DIR}/lib/Target/X86