1set(LLVM_LINK_COMPONENTS 2 MCParser 3 Support 4 native 5 ) 6 7add_llvm_tool(llvm-exegesis 8 DISABLE_LLVM_LINK_LLVM_DYLIB 9 llvm-exegesis.cpp 10 ) 11 12add_subdirectory(lib) 13 14# Link the native exegesis target if compiled and on the right host. 15if ((LLVM_TARGETS_TO_BUILD MATCHES "${LLVM_NATIVE_ARCH}") AND (LLVM_EXEGESIS_TARGETS MATCHES "${LLVM_NATIVE_ARCH}")) 16 set(LLVM_EXEGESIS_NATIVE_ARCH "${LLVM_NATIVE_ARCH}") 17endif() 18 19if (LLVM_EXEGESIS_NATIVE_ARCH) 20 set(LLVM_EXEGESIS_NATIVE_TARGET "LLVMExegesis${LLVM_EXEGESIS_NATIVE_ARCH}") 21 set_source_files_properties(llvm-exegesis.cpp PROPERTIES COMPILE_FLAGS "-DLLVM_EXEGESIS_INITIALIZE_NATIVE_TARGET=Initialize${LLVM_EXEGESIS_NATIVE_ARCH}ExegesisTarget") 22endif() 23 24target_link_libraries(llvm-exegesis PRIVATE 25 LLVMExegesis 26 ${LLVM_EXEGESIS_NATIVE_TARGET} 27 ) 28