2018-04-04 19:37:06 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS
|
2018-09-25 16:25:29 +08:00
|
|
|
MCParser
|
2018-04-04 19:37:06 +08:00
|
|
|
Support
|
|
|
|
native
|
|
|
|
)
|
|
|
|
|
|
|
|
add_llvm_tool(llvm-exegesis
|
|
|
|
llvm-exegesis.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
add_subdirectory(lib)
|
2018-06-19 19:28:59 +08:00
|
|
|
|
|
|
|
# Link the native exegesis target if compiled and on the right host.
|
2018-07-02 21:53:46 +08:00
|
|
|
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}")
|
2018-06-19 19:28:59 +08:00
|
|
|
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}
|
|
|
|
)
|