From be21ff11b7c25e3f6682c7987052557eca48e907 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 10 Sep 2019 16:37:45 +0200 Subject: CMake: Fix usage of debug frameworks on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If an app wants use a debug framework of Qt, it is still expected that the app should link against the release version, and just set DYLD_IMAGE_SUFFIX=_debug when running the app. This was not the case before, where the CMake Config files told CMake to link explicitly against the debug libraries. This caused crashes due to the Qt plugin loader mechanism still trying to find a release platform plugin, which in turn would load release libraries, and thus the application would end up loading both debug and release plugins. Make sure the Config files in a framework case always reference the release libraries (even though this might be counter intuitive). Otherwise users of the Debug Config files would always get crashes. Fixes: QTBUG-78131 Change-Id: I88b1dc421477ad186012ca67b328a891128eb568 Reviewed-by: Cristian Adam Reviewed-by: Tor Arne Vestbø --- mkspecs/features/create_cmake.prf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index 376a7ded5d..314cd5cc67 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -254,7 +254,8 @@ mac { CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl } else { qt_framework { - CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}.framework/$${CMAKE_QT_STEM}_debug + # Intentionally there is no '_debug' infix for framework builds. + CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}.framework/$${CMAKE_QT_STEM} CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.framework/$${CMAKE_QT_STEM} CMAKE_BUILD_IS_FRAMEWORK = "true" } else { -- cgit v1.2.3