[PATCH] D95837: Fix CMake LLVM_TARGETS_TO_BUILD "Native" option to work with JIT
Mehdi AMINI via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 2 10:47:43 PST 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGbb0212929e36: Fix CMake LLVM_TARGETS_TO_BUILD "Native" option to work with JIT (authored by mehdi_amini).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95837/new/
https://reviews.llvm.org/D95837
Files:
llvm/CMakeLists.txt
llvm/cmake/config-ix.cmake
Index: llvm/cmake/config-ix.cmake
===================================================================
--- llvm/cmake/config-ix.cmake
+++ llvm/cmake/config-ix.cmake
@@ -453,13 +453,15 @@
message(FATAL_ERROR "Unknown architecture ${LLVM_NATIVE_ARCH}")
endif ()
-# If build targets includes "host", then replace with native architecture.
-list(FIND LLVM_TARGETS_TO_BUILD "host" idx)
-if( NOT idx LESS 0 )
- list(REMOVE_AT LLVM_TARGETS_TO_BUILD ${idx})
- list(APPEND LLVM_TARGETS_TO_BUILD ${LLVM_NATIVE_ARCH})
- list(REMOVE_DUPLICATES LLVM_TARGETS_TO_BUILD)
-endif()
+# If build targets includes "host" or "Native", then replace with native architecture.
+foreach (NATIVE_KEYWORD host Native)
+ list(FIND LLVM_TARGETS_TO_BUILD ${NATIVE_KEYWORD} idx)
+ if( NOT idx LESS 0 )
+ list(REMOVE_AT LLVM_TARGETS_TO_BUILD ${idx})
+ list(APPEND LLVM_TARGETS_TO_BUILD ${LLVM_NATIVE_ARCH})
+ list(REMOVE_DUPLICATES LLVM_TARGETS_TO_BUILD)
+ endif()
+endforeach()
list(FIND LLVM_TARGETS_TO_BUILD ${LLVM_NATIVE_ARCH} NATIVE_ARCH_IDX)
if (NATIVE_ARCH_IDX EQUAL -1)
Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -669,10 +669,6 @@
# first cmake run
include(config-ix)
-string(REPLACE "Native" ${LLVM_NATIVE_ARCH}
- LLVM_TARGETS_TO_BUILD "${LLVM_TARGETS_TO_BUILD}")
-list(REMOVE_DUPLICATES LLVM_TARGETS_TO_BUILD)
-
# By default, we target the host, but this can be overridden at CMake
# invocation time.
set(LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_HOST_TRIPLE}" CACHE STRING
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95837.320852.patch
Type: text/x-patch
Size: 1579 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210202/ebadbb80/attachment.bin>
More information about the llvm-commits
mailing list