From ada449f7f2ccafdb46dd82486e9599fd01f0bf63 Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Mon, 20 May 2024 17:35:10 -0700 Subject: [PATCH] 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. --- cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake b/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake index d6078c07c4..f9cf6f930f 100644 --- a/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake +++ b/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake @@ -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