Skip to content

Commit

Permalink
Use the actual Python defined SO ABI extension
Browse files Browse the repository at this point in the history
Which is basically a call to sysconfig made by the find_package Python
and outputs the following extension

```python
sysconfig.get_config_var('EXT_SUFFIX')
'.cpython-310-x86_64-linux-gnu.so'
```

Contributes to CURA-7924
  • Loading branch information
j.spijker@ultimaker.com authored and jellespijker committed Feb 25, 2022
1 parent 12d420d commit b1325c9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cmake/SIPMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ function(add_sip_module MODULE_TARGET)
configure_file(${CMAKE_SOURCE_DIR}/pyproject.toml.in ${CMAKE_CURRENT_BINARY_DIR}/pyproject.toml)
configure_file(${CMAKE_SOURCE_DIR}/cmake/CMakeBuilder.py ${CMAKE_CURRENT_BINARY_DIR}/CMakeBuilder.py)
if(WIN32)
set(ext .pyd)
set(env_path_sep ";")
else()
set(ext .so)
set(env_path_sep ":")
endif()

Expand Down Expand Up @@ -64,7 +62,7 @@ function(add_sip_module MODULE_TARGET)
# Make sure that the library name of the target is the same as the MODULE_TARGET with the appropriate extension
target_link_libraries("sip_${MODULE_TARGET}" PRIVATE "${MODULE_TARGET}")
set_target_properties("sip_${MODULE_TARGET}" PROPERTIES PREFIX "")
set_target_properties("sip_${MODULE_TARGET}" PROPERTIES SUFFIX ${ext})
set_target_properties("sip_${MODULE_TARGET}" PROPERTIES SUFFIX ${Python_SOABI})
set_target_properties("sip_${MODULE_TARGET}" PROPERTIES OUTPUT_NAME "${MODULE_TARGET}")

# Add the custom command to (re-)generate the files and mark them as dirty. This allows the user to actually work
Expand Down

0 comments on commit b1325c9

Please sign in to comment.