1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/tools/llvm-exegesis/CMakeLists.txt
John Brawn 42883315e9 [llvm-exegesis] Change how the native architecture is determined
Currently the llvm-exegesis native architecture is determined by comparing the
llvm native architecture with X86, so to add a new target would mean adding a
new check. Change this to building up a list of the targets llvm-exegesis
supports then using that, as this means that when adding a new target you just
add the target to the list of supported targets.

Differential Revision: https://reviews.llvm.org/D48778

llvm-svn: 336105
2018-07-02 13:53:46 +00:00

27 lines
760 B
CMake

set(LLVM_LINK_COMPONENTS
Support
native
)
add_llvm_tool(llvm-exegesis
llvm-exegesis.cpp
)
add_subdirectory(lib)
# Link the native exegesis target if compiled and on the right host.
if ((LLVM_TARGETS_TO_BUILD MATCHES "${LLVM_NATIVE_ARCH}") AND (LLVM_EXEGESIS_TARGETS MATCHES "${LLVM_NATIVE_ARCH}"))
set(LLVM_EXEGESIS_NATIVE_ARCH "${LLVM_NATIVE_ARCH}")
endif()
if (LLVM_EXEGESIS_NATIVE_ARCH)
set(LLVM_EXEGESIS_NATIVE_TARGET "LLVMExegesis${LLVM_EXEGESIS_NATIVE_ARCH}")
set_source_files_properties(llvm-exegesis.cpp PROPERTIES COMPILE_FLAGS "-DLLVM_EXEGESIS_INITIALIZE_NATIVE_TARGET=Initialize${LLVM_EXEGESIS_NATIVE_ARCH}ExegesisTarget")
endif()
target_link_libraries(llvm-exegesis PRIVATE
LLVMExegesis
${LLVM_EXEGESIS_NATIVE_TARGET}
)