From 78a6b807195b5dee50f5f6b2e1a86f49af60cb39 Mon Sep 17 00:00:00 2001 From: Artem Pisarenko Date: Thu, 16 Jan 2020 14:47:00 +0600 Subject: Fix win32 support for linking against static builds in CMake CMake mkspec feature sets CMAKE_PRL_FILE_LOCATION_* values inconsistent with actual .prl file names being generated/installed, causing dependency extraction mechanism in Qt5BasicConfig.cmake.in to not work (function _qt5_$${CMAKE_MODULE_NAME}_process_prl_file silently fails to find file at given location and skips filling libs deps). [ChangeLog][CMake][Windows] Fixed linking with Qt static build Fixes: QTBUG-81401 Change-Id: I5861cc0c42163d898ba55ad83cbad1994dcb1db2 Reviewed-by: Alexandru Croitor --- mkspecs/features/create_cmake.prf | 41 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) (limited to 'mkspecs/features/create_cmake.prf') diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index 346fbf2467..0d93597012 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -212,21 +212,17 @@ contains(CONFIG, plugin) { CMAKE_PLUGIN_TYPE_ESCAPED = $$replace(PLUGIN_TYPE, [-/], _) win32 { + CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.prl + CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.prl isEmpty(CMAKE_STATIC_TYPE) { CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.dll CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.dll - CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.prl - CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.prl } else:mingw { CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}.a CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}d.a - CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}.prl - CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}d.prl } else { # MSVC static CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.lib CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.lib - CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.prl - CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.prl } } else { mac { @@ -316,36 +312,25 @@ mac { CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.dll CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.dll + !isEmpty(CMAKE_STATIC_TYPE) { + CMAKE_STATIC_WINDOWS_BUILD = "true" + + CMAKE_PRL_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.prl + CMAKE_PRL_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.prl + } + mingw { CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqtmain$${QT_LIBINFIX}d.a CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqtmain$${QT_LIBINFIX}.a - !isEmpty(CMAKE_STATIC_TYPE) { - CMAKE_STATIC_WINDOWS_BUILD = "true" - CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.a - CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a - - CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.prl - CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl - } else { - CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.a - CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a - } + CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.a + CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a } else { CMAKE_WINMAIN_FILE_LOCATION_DEBUG = qtmain$${QT_LIBINFIX}d.lib CMAKE_WINMAIN_FILE_LOCATION_RELEASE = qtmain$${QT_LIBINFIX}.lib - !isEmpty(CMAKE_STATIC_TYPE) { - CMAKE_STATIC_WINDOWS_BUILD = "true" - CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib - CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib - - CMAKE_PRL_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.prl - CMAKE_PRL_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.prl - } else { - CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib - CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib - } + CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib + CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib } } else { !isEmpty(CMAKE_STATIC_TYPE) { -- cgit v1.2.3