Clean CMakeLists.txt

The extension module was incorrectly built as a shared library. We ended up with 3 files on Linux:

  • _tango.so
  • _tango.so.10
  • _tango.so.10.1.0

Same on macOS but always ending with .so as we forced the SUFFIX. On Windows we only had _tango.pyd.

The extension should be a MODULE, not SHARED.

The SOABI was also missing in the filename. Use pybind11_add_module instead of add_library as it does the right thing.

Remove extra options that aren't needed, like CXX_VISIBILITY_PRESET which is already set (-fvisibility=hidden is still set). Note that VISIBILITY_INLINES_HIDDEN is still needed (Without it -fvisibility-inlines-hidden is set on macOS but not Linux).

Instead of having 3 files on Linux and macOS, we now only have one: _tango.cpython-313-darwin.so. Saving some space in the wheel.

This fixes the issue on the desy runner where _tango.so.10.1.0 was set as extension module in editable mode but couldn't be used as it doesn't end with .so. See https://github.com/scikit-build/scikit-build-core/issues/1144

Thanks a lot to @henryiii for the suggestions!

Edited by Benjamin Bertrand

Merge request reports

Loading