From 1feada074ea70247fce2349b1dd8064c8fe8275b Mon Sep 17 00:00:00 2001 From: Shyamnath Premnadh Date: Tue, 2 Jan 2024 13:48:28 +0100 Subject: PySide: Fix debug build in windows - PYTHON_DEBUG_LIBRARIES does not exist in FindPython module and this cmake variable is equivalent to Python_LIBRARIES. PYTHON_DEBUG_LIBRARIES was already deprecated even before CMake 3.16. - Amends d5b56ebb1534a3359f03534a967bbe3cf2a5eb51 Task-number: PYSIDE-2439 Change-Id: Ie5f21d0c9f1518ffb47dae37b3d3897a35f33c0d Reviewed-by: Friedemann Kleint (cherry picked from commit 1c9fc19ef5b2885773cc5c8995221d8ce02e79f9) Reviewed-by: Qt Cherry-pick Bot --- build_scripts/main.py | 5 +---- sources/shiboken6/cmake/ShibokenHelpers.cmake | 14 +++----------- sources/shiboken6/cmake/ShibokenSetup.cmake | 1 - 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/build_scripts/main.py b/build_scripts/main.py index 834b466c5..4594c6ade 100644 --- a/build_scripts/main.py +++ b/build_scripts/main.py @@ -674,10 +674,7 @@ class PysideBuild(_build, CommandMixin, BuildInfoCollectorMixin): else: log.warning('numpy include directory was not found.') - if self.build_type.lower() == 'debug': - if not self.is_cross_compile: - cmake_cmd.append(f"-DPYTHON_DEBUG_LIBRARY={self.py_library}") - else: + if self.build_type.lower() != 'debug': if OPTION['NO_STRIP']: cmake_cmd.append("-DQFP_NO_STRIP=1") if OPTION['NO_OVERRIDE_OPTIMIZATION_FLAGS']: diff --git a/sources/shiboken6/cmake/ShibokenHelpers.cmake b/sources/shiboken6/cmake/ShibokenHelpers.cmake index f4a00af3f..6a0351899 100644 --- a/sources/shiboken6/cmake/ShibokenHelpers.cmake +++ b/sources/shiboken6/cmake/ShibokenHelpers.cmake @@ -15,7 +15,7 @@ endmacro() macro(set_debug_build) set(SHIBOKEN_BUILD_TYPE "Debug") - if(NOT PYTHON_DEBUG_LIBRARIES) + if(NOT Python_LIBRARIES) message(WARNING "Python debug shared library not found; \ assuming python was built with shared library support disabled.") endif() @@ -418,16 +418,8 @@ macro(shiboken_compute_python_libraries) set(SHIBOKEN_PYTHON_LIBRARIES "") endif() - if(CMAKE_BUILD_TYPE STREQUAL "Debug") - if(WIN32 AND NOT SHIBOKEN_PYTHON_LIBRARIES) - set(SHIBOKEN_PYTHON_LIBRARIES ${PYTHON_DEBUG_LIBRARIES}) - endif() - endif() - - if(CMAKE_BUILD_TYPE STREQUAL "Release") - if(WIN32 AND NOT SHIBOKEN_PYTHON_LIBRARIES) - set(SHIBOKEN_PYTHON_LIBRARIES ${Python_LIBRARIES}) - endif() + if(WIN32 AND NOT SHIBOKEN_PYTHON_LIBRARIES) + set(SHIBOKEN_PYTHON_LIBRARIES ${Python_LIBRARIES}) endif() # If the resulting variable diff --git a/sources/shiboken6/cmake/ShibokenSetup.cmake b/sources/shiboken6/cmake/ShibokenSetup.cmake index 664168933..32823d9fa 100644 --- a/sources/shiboken6/cmake/ShibokenSetup.cmake +++ b/sources/shiboken6/cmake/ShibokenSetup.cmake @@ -46,7 +46,6 @@ compute_config_py_values(shiboken6_VERSION) message(STATUS "Python_Development_FOUND: " ${Python_Development_FOUND}) message(STATUS "Python_LIBRARIES: " ${Python_LIBRARIES}) message(STATUS "Python_INCLUDE_DIRS: " ${Python_INCLUDE_DIRS}) -message(STATUS "Python_DEBUG_LIBRARIES: " ${PYTHON_DEBUG_LIBRARIES}) message(STATUS "Python_Interpreter_FOUND: " ${Python_Interpreter_FOUND}) message(STATUS "Python_EXECUTABLE: " ${Python_EXECUTABLE}) message(STATUS "Python_VERSION: " ${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}.${Python_VERSION_PATCH}) -- cgit v1.2.3