Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cpp/cmake_modules/UseCython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,9 @@ function(cython_add_module _name pyx_target_name generated_files)
add_dependencies(${_name} ${pyx_target_name})
endfunction()

execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from Cython.Compiler.Version import version; print(version)"
OUTPUT_VARIABLE CYTHON_VERSION_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CYTHON_VERSION "${CYTHON_VERSION_OUTPUT}")

include(CMakeParseArguments)
5 changes: 5 additions & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ message(STATUS "Found NumPy version: ${Python3_NumPy_VERSION}")
message(STATUS "NumPy include dir: ${NUMPY_INCLUDE_DIRS}")

include(UseCython)
message(STATUS "Found Cython version: ${CYTHON_VERSION}")

# Arrow C++ and set default PyArrow build options
include(GNUInstallDirs)
Expand Down Expand Up @@ -855,6 +856,10 @@ set(CYTHON_FLAGS "${CYTHON_FLAGS}" "--warning-errors")
# undocumented Cython feature.
set(CYTHON_FLAGS "${CYTHON_FLAGS}" "--no-c-in-traceback")

if(CYTHON_VERSION VERSION_GREATER_EQUAL "3.1.0a0")
list(APPEND CYTHON_FLAGS "-Xfreethreading_compatible=True")
endif()

foreach(module ${CYTHON_EXTENSIONS})
string(REPLACE "." ";" directories ${module})
list(GET directories -1 module_name)
Expand Down