Skip to content

Commit

Permalink
Merge pull request #73 from 171930433/feature/fix_bug
Browse files Browse the repository at this point in the history
修复python版本3.9以上,cyber_channel无法使用问题
  • Loading branch information
minhanghuang authored Aug 17, 2024
2 parents dbf522a + 8f12890 commit 3f3d3e0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cyber/python/internal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
add_library(_cyber_wrapper SHARED
py_cyber.cc
)

# Extract major and minor versions
string(REPLACE "." ";" VERSION_LIST "${Python_VERSION}")
list(GET VERSION_LIST 0 PYTHON_VERSION_MAJOR)
list(GET VERSION_LIST 1 PYTHON_VERSION_MINOR)

# Define PY_SSIZE_T_CLEAN if Python version is 3.9 or greater
if(PYTHON_VERSION_MAJOR GREATER_EQUAL 3 AND PYTHON_VERSION_MINOR GREATER_EQUAL 9)
target_compile_definitions(_cyber_wrapper PRIVATE PY_SSIZE_T_CLEAN)
endif()

target_link_libraries(_cyber_wrapper
${TARGET_NAME}
# ${CYBER_PYTHON_LIB}
Expand Down

0 comments on commit 3f3d3e0

Please sign in to comment.