Files
clang-p2996/bolt/lib/Rewrite/CMakeLists.txt
Amir Ayupov c34adaa3ca [BOLT][CMAKE] Use IN_LIST check
Summary:
Address @smeenai feedback https://reviews.llvm.org/D117061#inline-1122106:
>CMake has if(IN_LIST) now, which you can use instead of the string(FIND)

IN_LIST is available since CMake 3.3 released in 2015.

Reviewed By: smeenai

FBD33590959
2022-01-14 15:47:14 -08:00

44 lines
833 B
CMake

set(LLVM_LINK_COMPONENTS
BOLTCore
BOLTPasses
BOLTProfile
BOLTRuntimeLibs
BOLTUtils
DebugInfoDWARF
DWP
ExecutionEngine
MC
Object
Support
)
if ("AArch64" IN_LIST LLVM_TARGETS_TO_BUILD)
list(APPEND LLVM_LINK_COMPONENTS BOLTTargetAArch64)
set(BOLT_AArch64 On)
endif()
if ("X86" IN_LIST LLVM_TARGETS_TO_BUILD)
list(APPEND LLVM_LINK_COMPONENTS BOLTTargetX86)
set(BOLT_X64 On)
endif()
add_llvm_library(LLVMBOLTRewrite
BinaryPassManager.cpp
BoltDiff.cpp
DWARFRewriter.cpp
ExecutableFileMemoryManager.cpp
MachORewriteInstance.cpp
RewriteInstance.cpp
LINK_LIBS
${LLVM_PTHREAD_LIB}
)
if (DEFINED BOLT_AArch64)
target_compile_definitions(LLVMBOLTRewrite PRIVATE AARCH64_AVAILABLE)
endif()
if (DEFINED BOLT_X64)
target_compile_definitions(LLVMBOLTRewrite PRIVATE X86_AVAILABLE)
endif()