File tree Expand file tree Collapse file tree 4 files changed +35
-16
lines changed Expand file tree Collapse file tree 4 files changed +35
-16
lines changed Original file line number Diff line number Diff line change 51
51
- python-version : " 3.9"
52
52
runs-on : ubuntu-latest
53
53
cmake : " 3.20.x"
54
+ - python-version : " 3.10"
55
+ runs-on : ubuntu-latest
56
+ cmake : " 3.15.x"
54
57
55
58
steps :
56
59
- uses : actions/checkout@v4
67
70
with :
68
71
cmake-version : ${{ matrix.cmake }}
69
72
73
+ - run : pipx install ninja
74
+ if : matrix.cmake == '3.15.x'
75
+
70
76
- uses : yezz123/setup-uv@v4
71
77
72
78
- name : Install package
Original file line number Diff line number Diff line change 18
18
# ``Cython::Cython``
19
19
# The Cython executable
20
20
#
21
+ # A range of versions is supported on CMake 3.19+.
22
+ #
21
23
# For more information on the Cython project, see https://cython.org/.
22
24
#
23
25
# *Cython is a language that makes writing C extensions for the Python language
39
41
# limitations under the License.
40
42
#=============================================================================
41
43
42
- if (CMAKE_VERSION VERSION_LESS "3.20" )
43
- message (SEND_ERROR "CMake 3.20 required" )
44
- endif ()
45
-
46
44
# Use the Cython executable that lives next to the Python executable
47
45
# if it is a local installation.
48
46
if (Python_EXECUTABLE )
@@ -88,11 +86,19 @@ if(CYTHON_EXECUTABLE)
88
86
endif ()
89
87
90
88
include (FindPackageHandleStandardArgs )
91
- find_package_handle_standard_args (Cython
92
- REQUIRED_VARS CYTHON_EXECUTABLE
93
- VERSION_VAR ${CYTHON_VERSION}
94
- HANDLE_VERSION_RANGE
95
- )
89
+
90
+ if (CMAKE_VERSION VERSION_LESS 3.19 )
91
+ find_package_handle_standard_args (Cython
92
+ REQUIRED_VARS CYTHON_EXECUTABLE
93
+ VERSION_VAR ${CYTHON_VERSION}
94
+ )
95
+ else ()
96
+ find_package_handle_standard_args (Cython
97
+ REQUIRED_VARS CYTHON_EXECUTABLE
98
+ VERSION_VAR ${CYTHON_VERSION}
99
+ HANDLE_VERSION_RANGE
100
+ )
101
+ endif ()
96
102
97
103
if (CYTHON_FOUND )
98
104
if (NOT DEFINED Cython::Cython )
Original file line number Diff line number Diff line change 72
72
# limitations under the License.
73
73
#=============================================================================
74
74
75
- if (CMAKE_VERSION VERSION_LESS "3.20 " )
76
- message (FATAL_ERROR "CMake 3.20 required" )
75
+ if (CMAKE_VERSION VERSION_LESS "3.7 " )
76
+ message (SEND_ERROR "CMake 3.7 required for DEPFILE " )
77
77
endif ()
78
78
79
79
@@ -124,14 +124,21 @@ function(Cython_compile_pyx)
124
124
endif ()
125
125
126
126
# Place the cython files in the current binary dir if no path given
127
+ # Can use cmake_path for CMake 3.20+
127
128
if (NOT CYTHON_OUTPUT )
128
- cmake_path (GET INPUT STEM basename )
129
- cmake_path (APPEND CMAKE_CURRENT_BINARY_DIR "${basename}${langauge_ext} " OUTPUT_VARIABLE CYTHON_OUTPUT )
129
+ # cmake_path(GET INPUT STEM basename)
130
+ get_filename_component (basename "${INPUT} " NAME_WE )
131
+
132
+ # cmake_path(APPEND CMAKE_CURRENT_BINARY_DIR "${basename}${langauge_ext}" OUTPUT_VARIABLE CYTHON_OUTPUT)
133
+ set (CYTHON_OUPUT "${CMAKE_CURRENT_BINARY_DIR} /${basename}${langauge_ext} " )
130
134
endif ()
131
- cmake_path (ABSOLUTE_PATH CYTHON_OUTPUT )
135
+
136
+ # cmake_path(ABSOLUTE_PATH CYTHON_OUTPUT)
137
+ get_filename_component (CYTHON_OUTPUT "${CYTHON_OUPUT} " ABSOLUTE )
132
138
133
139
# Normalize the input path
134
- cmake_path (ABSOLUTE_PATH INPUT )
140
+ # cmake_path(ABSOLUTE_PATH INPUT)
141
+ get_filename_component (INPUT "${INPUT} " ABSOLUTE )
135
142
set_source_files_properties ("${INPUT} " PROPERTIES GENERATED TRUE )
136
143
137
144
# Support
Original file line number Diff line number Diff line change 1
- cmake_minimum_required (VERSION 3.20 ...3.29 )
1
+ cmake_minimum_required (VERSION 3.15 ...3.29 )
2
2
project (${SKBUILD_PROJECT_NAME} LANGUAGES C )
3
3
4
4
find_package (
You can’t perform that action at this time.
0 commit comments