]> git.pld-linux.org Git - packages/llvm.git/blame - llvm-python-modules.patch
up to 11.0.0
[packages/llvm.git] / llvm-python-modules.patch
CommitLineData
f784323b
JP
1--- llvm-11.0.0.src/CMakeLists.txt.orig 2020-10-07 12:10:48.000000000 +0200
2+++ llvm-11.0.0.src/CMakeLists.txt 2020-10-13 01:18:33.807817497 +0200
3@@ -646,6 +646,23 @@
200602f4
JB
4 set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR OFF CACHE BOOL
5 "Enable per-target runtimes directory")
6
200602f4
JB
7+include(FindPythonInterp)
8+if( NOT PYTHONINTERP_FOUND )
9+ message(FATAL_ERROR
10+"Unable to find Python interpreter, required for builds and testing.
11+
12+Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
13+endif()
14+
15+if( ${PYTHON_VERSION_STRING} VERSION_LESS 2.7 )
16+ message(FATAL_ERROR "Python 2.7 or newer is required")
17+endif()
18+
f784323b
JP
19+add_executable(Python3::Interpreter IMPORTED)
20+set_target_properties(Python3::Interpreter PROPERTIES
21+ IMPORTED_LOCATION ${PYTHON_EXECUTABLE})
22+set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
23+
24 set(LLVM_PROFDATA_FILE "" CACHE FILEPATH
25 "Profiling data file to use when compiling in order to improve runtime performance.")
26
27@@ -679,40 +691,6 @@
200602f4
JB
28
29 include(HandleLLVMOptions)
30
f784323b
JP
31-if(CMAKE_VERSION VERSION_LESS 3.12)
32- include(FindPythonInterp)
33- if( NOT PYTHONINTERP_FOUND )
34- message(FATAL_ERROR
35- "Unable to find Python interpreter, required for builds and testing.
200602f4 36-
f784323b
JP
37- Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
38- endif()
39-
40- if( ${PYTHON_VERSION_STRING} VERSION_LESS 2.7 )
41- message(FATAL_ERROR "Python 2.7 or newer is required")
42- endif()
43-
44- add_executable(Python3::Interpreter IMPORTED)
45- set_target_properties(Python3::Interpreter PROPERTIES
46- IMPORTED_LOCATION ${PYTHON_EXECUTABLE})
47- set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
48-else()
49- find_package(Python3 COMPONENTS Interpreter)
50- if(NOT Python3_Interpreter_FOUND)
51- message(WARNING "Python3 not found, using python2 as a fallback")
52- find_package(Python2 COMPONENTS Interpreter REQUIRED)
53- if(Python2_VERSION VERSION_LESS 2.7)
54- message(SEND_ERROR "Python 2.7 or newer is required")
55- endif()
200602f4 56-
f784323b
JP
57- # Treat python2 as python3
58- add_executable(Python3::Interpreter IMPORTED)
59- set_target_properties(Python3::Interpreter PROPERTIES
60- IMPORTED_LOCATION ${Python2_EXECUTABLE})
61- set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
62- endif()
200602f4
JB
63-endif()
64-
65 ######
66 # LLVMBuild Integration
67 #
This page took 0.118396 seconds and 4 git commands to generate.