CMake: ensure shiboken does not introduce Py_LIMITED_API.

On some builds, the CMake package files for PySide6's Shiboken set the Py_LIMITED_API define on
the compiler's command line.  This breaks FreeCAD as it depends on definitions from the Python
Stable API unavailable with the Limited API.
This commit is contained in:
Jacob Oursland
2024-05-20 17:35:10 -07:00
parent 72829d07b4
commit ada449f7f2

View File

@@ -37,6 +37,10 @@ macro(SetupShibokenAndPyside)
message(STATUS "PYTHON_CONFIG_SUFFIX: ${PYTHON_CONFIG_SUFFIX}")
find_package(Shiboken${SHIBOKEN_MAJOR_VERSION} QUIET)
endif()
if(SHIBOKEN_MAJOR_VERSION EQUAL 6)
set_target_properties(Shiboken6::libshiboken PROPERTIES INTERFACE_COMPILE_DEFINITIONS "NDEBUG")
endif()
endif()
# pyside2 changed its cmake files, this is the dance we have