Skip to content

Commit 9342bde

Browse files
committed
feat: add CYTHON_ARGS variable
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 26b1889 commit 9342bde

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/cython_cmake/cmake/UseCython.cmake

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# using cython.
99
#
1010
# Cython_compile_pyx(<pyx_file>
11-
# LANGUAGE C | CXX
11+
# [LANGUAGE C | CXX]
1212
# [CYTHON_ARGS <args> ...]
1313
# [OUTPUT <OutputFile>]
1414
# [OUTPUT_VARIABLE <OutputVariable>]
@@ -17,12 +17,12 @@
1717
# Options:
1818
#
1919
# ``LANGUAGE [C | CXX]``
20-
# Force the generation of either a C or C++ file. Required.
20+
# Force the generation of either a C or C++ file. Recommended; will attempt
21+
# to be deduced if not specified.
2122
#
22-
# ``OUTPUT <OutputFile>``
23-
# Specify a specific path for the output file as ``<OutputFile>``. By
24-
# default, this will output into the current binary dir. A depfile will be
25-
# created alongside this file as well.
23+
# ``CYTHON_ARGS <args>``
24+
# Specify additional arguments for the cythonization process. Will default to
25+
# the ``CYTHON_ARGS`` variable if not specified.
2626
#
2727
# ``OUTPUT <OutputFile>``
2828
# Specify a specific path for the output file as ``<OutputFile>``. By
@@ -134,7 +134,12 @@ function(Cython_compile_pyx)
134134
cmake_path(ABSOLUTE_PATH INPUT)
135135
set_source_files_properties("${INPUT}" PROPERTIES GENERATED TRUE)
136136

137+
# Support
138+
if(NOT CYTHON_CYTHON_ARGS AND DEFINED CYTHON_ARGS)
139+
set(CYTHON_CYTHON_ARGS "${CYTHON_ARGS}")
140+
endif()
137141

142+
# Output variable only if set
138143
if(CYTHON_OUTPUT_VARIABLE)
139144
set(${CYTHON_OUTPUT_VARIABLE} "${CYTHON_OUTPUT}" PARENT_SCOPE)
140145
endif()

0 commit comments

Comments
 (0)