Skip to content

Commit 5290595

Browse files
committed
Tell cython that we are freethreading compatible
1 parent 4f0775a commit 5290595

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

symengine/lib/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,16 @@ add_custom_command(
3131
COMMENT "Preprocessing symengine_wrapper.in.pyx"
3232
)
3333

34+
if ("${CYTHON_VERSION}" VERSION_GREATER_EQUAL "3.1")
35+
set(CYTHON_EXTRA_ARGS "-Xfreethreading_compatible=True")
36+
endif()
37+
3438
cython_transpile(
3539
${CMAKE_CURRENT_BINARY_DIR}/symengine_wrapper.pyx
3640
LANGUAGE CXX
3741
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/symengine_wrapper.cpp
3842
CYTHON_ARGS
43+
${CYTHON_EXTRA_ARGS}
3944
-I ${CMAKE_CURRENT_BINARY_DIR}
4045
-I ${CMAKE_CURRENT_SOURCE_DIR}
4146
)
@@ -101,7 +106,7 @@ install(
101106
FILES
102107
__init__.py
103108
symengine.pxd
104-
symengine_wrapper.pxd
109+
${CMAKE_CURRENT_BINARY_DIR}/symengine_wrapper.pxd
105110
pywrapper.h
106111
DESTINATION symengine/lib
107112
)

0 commit comments

Comments
 (0)