[PATCH] D84823: [CMake] find python should before include cmake-ix
Peiyuan Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 28 21:23:26 PDT 2020
SquallATF created this revision.
Herald added subscribers: llvm-commits, mgorny.
Herald added a project: LLVM.
SquallATF requested review of this revision.
because cmake-ix use `Python3_EXECUTABLE` before it defined.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D84823
Files:
llvm/CMakeLists.txt
Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -641,36 +641,6 @@
set(LLVM_PROFDATA_FILE "" CACHE FILEPATH
"Profiling data file to use when compiling in order to improve runtime performance.")
-# All options referred to from HandleLLVMOptions have to be specified
-# BEFORE this include, otherwise options will not be correctly set on
-# 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
- "Default target for which LLVM will generate code." )
-set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
-message(STATUS "LLVM host triple: ${LLVM_HOST_TRIPLE}")
-message(STATUS "LLVM default target triple: ${LLVM_DEFAULT_TARGET_TRIPLE}")
-
-if(WIN32 OR CYGWIN)
- if(BUILD_SHARED_LIBS OR LLVM_BUILD_LLVM_DYLIB)
- set(LLVM_ENABLE_PLUGINS_default ON)
- else()
- set(LLVM_ENABLE_PLUGINS_default OFF)
- endif()
-else()
- set(LLVM_ENABLE_PLUGINS_default ${LLVM_ENABLE_PIC})
-endif()
-option(LLVM_ENABLE_PLUGINS "Enable plugin support" ${LLVM_ENABLE_PLUGINS_default})
-
-include(HandleLLVMOptions)
-
if(CMAKE_VERSION VERSION_LESS 3.12)
include(FindPythonInterp)
if( NOT PYTHONINTERP_FOUND )
@@ -705,6 +675,36 @@
endif()
endif()
+# All options referred to from HandleLLVMOptions have to be specified
+# BEFORE this include, otherwise options will not be correctly set on
+# 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
+ "Default target for which LLVM will generate code." )
+set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
+message(STATUS "LLVM host triple: ${LLVM_HOST_TRIPLE}")
+message(STATUS "LLVM default target triple: ${LLVM_DEFAULT_TARGET_TRIPLE}")
+
+if(WIN32 OR CYGWIN)
+ if(BUILD_SHARED_LIBS OR LLVM_BUILD_LLVM_DYLIB)
+ set(LLVM_ENABLE_PLUGINS_default ON)
+ else()
+ set(LLVM_ENABLE_PLUGINS_default OFF)
+ endif()
+else()
+ set(LLVM_ENABLE_PLUGINS_default ${LLVM_ENABLE_PIC})
+endif()
+option(LLVM_ENABLE_PLUGINS "Enable plugin support" ${LLVM_ENABLE_PLUGINS_default})
+
+include(HandleLLVMOptions)
+
######
# LLVMBuild Integration
#
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84823.281463.patch
Type: text/x-patch
Size: 2666 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200729/f8a87cb6/attachment.bin>
More information about the llvm-commits
mailing list