diff options
author | John Brawn <john.brawn@arm.com> | 2018-07-02 13:53:46 +0000 |
---|---|---|
committer | John Brawn <john.brawn@arm.com> | 2018-07-02 13:53:46 +0000 |
commit | 346856dc6c208fc103ca6838ec3a552cccad9267 (patch) | |
tree | 75bc4bdcb0dd9d2e1689156fae30002af93ee0e4 | |
parent | c48908781d540d5407245520fb4fe6e6a2f69ef8 (diff) | |
download | bcm5719-llvm-346856dc6c208fc103ca6838ec3a552cccad9267.tar.gz bcm5719-llvm-346856dc6c208fc103ca6838ec3a552cccad9267.zip |
[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
-rw-r--r-- | llvm/tools/llvm-exegesis/CMakeLists.txt | 4 | ||||
-rw-r--r-- | llvm/tools/llvm-exegesis/lib/CMakeLists.txt | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/llvm/tools/llvm-exegesis/CMakeLists.txt b/llvm/tools/llvm-exegesis/CMakeLists.txt index 01a795b4468..65b1ada8529 100644 --- a/llvm/tools/llvm-exegesis/CMakeLists.txt +++ b/llvm/tools/llvm-exegesis/CMakeLists.txt @@ -11,8 +11,8 @@ add_llvm_tool(llvm-exegesis add_subdirectory(lib) # Link the native exegesis target if compiled and on the right host. -if ((LLVM_TARGETS_TO_BUILD MATCHES "X86") AND ("${LLVM_NATIVE_ARCH}" STREQUAL "X86")) - set(LLVM_EXEGESIS_NATIVE_ARCH "X86") +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) diff --git a/llvm/tools/llvm-exegesis/lib/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/CMakeLists.txt index 02eeb758fcf..3c69dea7e24 100644 --- a/llvm/tools/llvm-exegesis/lib/CMakeLists.txt +++ b/llvm/tools/llvm-exegesis/lib/CMakeLists.txt @@ -1,5 +1,6 @@ if (LLVM_TARGETS_TO_BUILD MATCHES "X86") add_subdirectory(X86) + set(LLVM_EXEGESIS_TARGETS "${LLVM_EXEGESIS_TARGETS} X86" PARENT_SCOPE) endif() add_library(LLVMExegesis |