Skip to content

Commit bfa2dcf

Browse files
committed
refactor: remove back-compat function
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 2fb523c commit bfa2dcf

File tree

1 file changed

+0
-94
lines changed

1 file changed

+0
-94
lines changed

src/cython_cmake/cmake/UseCython.cmake

Lines changed: 0 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@
5656
# )
5757
#
5858
#
59-
# .. cmake:command:: add_cython_target
60-
#
61-
# Create a custom rule to generate the source code for a Python extension
62-
# module using cython. DEPRECATED; provided for backward compatibility with
63-
# scikit-build (classic) only.
64-
#
65-
#
6659
#=============================================================================
6760
# Copyright 2011 Kitware, Inc.
6861
#
@@ -84,93 +77,6 @@ if(CMAKE_VERSION VERSION_LESS "3.20")
8477
endif()
8578

8679

87-
function(add_cython_target _name)
88-
message(WARNING "DEPRECATED: use cython_compile_pyx instead of add_cython_target.")
89-
set(_options C CXX PY2 PY3)
90-
set(_one_value OUTPUT_VAR)
91-
set(_multi_value )
92-
93-
cmake_parse_arguments(_args
94-
"${_options}"
95-
"${_one_value}"
96-
"${_multi_value}"
97-
${ARGN}
98-
)
99-
100-
# Configuration options.
101-
set(CYTHON_ANNOTATE OFF
102-
CACHE BOOL "Create an annotated .html file when compiling *.pyx.")
103-
104-
set(CYTHON_FLAGS "" CACHE STRING
105-
"Extra flags to the cython compiler.")
106-
mark_as_advanced(CYTHON_ANNOTATE CYTHON_FLAGS)
107-
108-
if(_args_C)
109-
set(_target_language "C")
110-
endif()
111-
if(_args_CXX)
112-
set(_target_language "CXX")
113-
endif()
114-
115-
list(GET _args_UNPARSED_ARGUMENTS 0 _arg0)
116-
117-
# if provided, use _arg0 as the input file path
118-
if(_arg0)
119-
set(_source_file ${_arg0})
120-
121-
# otherwise, must determine source file from name, or vice versa
122-
else()
123-
get_filename_component(_name_ext "${_name}" EXT)
124-
125-
# if extension provided, _name is the source file
126-
if(_name_ext)
127-
set(_source_file ${_name})
128-
get_filename_component(_name "${_source_file}" NAME_WE)
129-
130-
# otherwise, assume the source file is ${_name}.pyx
131-
else()
132-
set(_source_file ${_name}.pyx)
133-
endif()
134-
endif()
135-
136-
# Set additional flags.
137-
set(_cython_args)
138-
if(_args_PY2)
139-
list(APPEND "--2")
140-
endif()
141-
if(_args_PY3)
142-
list(APPEND "--3")
143-
endif()
144-
145-
if(CYTHON_ANNOTATE)
146-
list(APPEND _cython_args "--annotate")
147-
endif()
148-
149-
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR
150-
CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
151-
list(APPEND _cython_args
152-
"--gdb"
153-
"--line-directives"
154-
)
155-
endif()
156-
string(STRIP "${CYTHON_FLAGS}" _stripped_cython_flags)
157-
if(_stripped_cython_flags)
158-
string(REGEX REPLACE " " ";" CYTHON_FLAGS_LIST "${_stripped_cython_flags}")
159-
list(APPEND _cython_args ${CYTHON_FLAGS_LIST})
160-
endif()
161-
162-
Cython_compile_pyx(
163-
"${_source_file}"
164-
LANGUAGE ${_target_language}
165-
CYTHON_ARGS ${_cython_args}
166-
OUTPUT_VARIABLE ${_args_OUTPUT_VAR}
167-
)
168-
169-
if(_args_OUTPUT_VAR)
170-
set(${_args_OUTPUT_VAR} ${${_args_OUTPUT_VAR}} PARENT_SCOPE)
171-
endif()
172-
endfunction()
173-
17480
function(Cython_compile_pyx INPUT)
17581
cmake_parse_arguments(
17682
PARSE_ARGV 1

0 commit comments

Comments
 (0)