Skip to content

Commit

Permalink
[BOLT-UnitTests] Fix shared libraries build
Browse files Browse the repository at this point in the history
Fix build with `-DBUILD_SHARED_LIBS=ON` (add explicit deps).

Reviewed By: yota9

Differential Revision: https://reviews.llvm.org/D119042
  • Loading branch information
aaupov committed Feb 5, 2022
1 parent b9d4fe8 commit eddf384
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions 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
Expand Down

0 comments on commit eddf384

Please sign in to comment.