diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-09-10 16:37:45 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-09-12 23:24:01 +0200 |
commit | afec5935ea811755c14683a162868b1a5cfb7ed5 (patch) | |
tree | 56a7f06e38ac6f71d11ff8d1fa0ebd24100204a4 | |
parent | 3a50e51b012eddeee1af6d2d781151b22f47de6f (diff) |
CMake: Fix usage of debug frameworks on macOS
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
Fixes: QTBUG-78239
Change-Id: I88b1dc421477ad186012ca67b328a891128eb568
(cherry picked from commit be21ff11b7c25e3f6682c7987052557eca48e907)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r-- | mkspecs/features/create_cmake.prf | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index 00da9bd33f..02e5775983 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -228,7 +228,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 { |