From 06a7da3c3d9654748e21efff72db6f85c319ea43 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 13 Jan 2020 11:35:43 +0100 Subject: yacc: Output the path for the move with the right directory separator Change-Id: Ic075711062750dde3e3a6bc7a5ba8da25ddecfe9 Reviewed-by: Joerg Bornemann --- mkspecs/features/yacc.prf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/yacc.prf b/mkspecs/features/yacc.prf index 0c7ff7321e..8acb9bc4bd 100644 --- a/mkspecs/features/yacc.prf +++ b/mkspecs/features/yacc.prf @@ -30,8 +30,8 @@ defineReplace(yaccCommands) { commands = \ -$(DEL_FILE) $${hpp_output} $${cpp_output}$$escape_expand(\\n\\t) \ $${yacc_call}$$escape_expand(\\n\\t) \ - $(MOVE) $${YACC_DIR}/$${QMAKE_YACC_HEADER} $${hpp_output}$$escape_expand(\\n\\t) \ - $(MOVE) $${YACC_DIR}/$${QMAKE_YACC_SOURCE} $${cpp_output}$$escape_expand(\\n\\t) + $(MOVE) $$shell_path($${YACC_DIR}/$${QMAKE_YACC_HEADER}) $${hpp_output}$$escape_expand(\\n\\t) \ + $(MOVE) $$shell_path($${YACC_DIR}/$${QMAKE_YACC_SOURCE}) $${cpp_output}$$escape_expand(\\n\\t) silent: commands = @echo Yacc $$1 && $$commands return($$commands) -- cgit v1.2.3 From 457ab46936f4c90099a0f1b16abaff5312037fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 14 Jan 2020 16:52:54 +0100 Subject: Handle resources with dots in the qrc file name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We were removing the .qrc suffix of resources in a way that assumed the filenames would not have any dots in them, but this is not always the case, and we would end up resolving an empty resource name for file names such as .rcc-bar.qrc (e.g. as produced by the qmlcache system). We now remove the .qrc extension explicitly. Change-Id: I50e1d88ac71ca1335bb05f3dbbb2d9bb441a8d64 Fixes: QTBUG-81255 Reviewed-by: Tor Arne Vestbø --- mkspecs/features/resources.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkspecs') diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index cee0981db0..6d9f27b86b 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -30,7 +30,7 @@ qtFlattenResources() "{" \ for (resource, RESOURCES) { - resource_name = $$section($$list($$basename(resource)), ., 0, 0) + resource_name = $$replace($$list($$basename(resource)),\.qrc$, ) resource_name = $$replace(resource_name, [^a-zA-Z0-9_], _) RESOURCE_INIT_CONT += " Q_INIT_RESOURCE($$resource_name);" } -- cgit v1.2.3 From 12df6c63a0272408f3fa369dccc3c9eb0486a7f8 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 15 Jan 2020 12:05:26 +0100 Subject: Android: Use the values rather than the variables with str_member This amends ce04fa345dbe52a022b592dde3ff49514c66b4c2 to correctly get the information out of the variables when using str_member and str_size, as it wants a string rather than a variable for these. Fixes: QTBUG-80582 Change-Id: I8e18e05c605ba1596a7ed7a013f5c6677ab76891 Reviewed-by: BogDan Vatra --- mkspecs/features/android/android.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkspecs') diff --git a/mkspecs/features/android/android.prf b/mkspecs/features/android/android.prf index 8290286ec6..6990417536 100644 --- a/mkspecs/features/android/android.prf +++ b/mkspecs/features/android/android.prf @@ -36,7 +36,7 @@ build_pass { } } } else: contains(TEMPLATE, "lib"):!static:!QTDIR_build:android_install { - tmpvar = $$str_member(TARGET, -$$str_size(QT_ARCH), -1) + tmpvar = $$str_member($$TARGET, -$$str_size($${QT_ARCH}), -1) !equals(tmpvar, $${QT_ARCH}): TARGET = $${TARGET}_$${QT_ARCH} target.path = /libs/$$ANDROID_TARGET_ARCH/ INSTALLS *= target -- cgit v1.2.3 From d5c9d88885916265819d7f6d3f336cf39ca1a863 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 14 Jan 2020 16:55:26 +0100 Subject: [CMake] Fix handling Qt frameworks link flags in static lib deps QMAKE_PRL_LIBS_FOR_CMAKE can contain "-F/foo/bar" entries which are search paths for where frameworks should be found. These should be passed as HINTS to find_library when searching for frameworks. Fixes: QTBUG-81369 Change-Id: I4f699800bd49a1f368b6132823e23d08d1fae604 Reviewed-by: Friedemann Kleint Reviewed-by: Joerg Bornemann --- mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index 26d4c17e6c..50364765fb 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -72,6 +72,7 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura string(REGEX REPLACE \"QMAKE_PRL_LIBS_FOR_CMAKE[ \\t]*=[ \\t]*([^\\n]*)\" \"\\\\1\" _static_depends \"${_prl_strings}\") string(REGEX REPLACE \"[ \\t]+\" \";\" _standard_libraries \"${CMAKE_CXX_STANDARD_LIBRARIES}\") set(_search_paths) + set(_fw_search_paths) set(_framework_flag) string(REPLACE \"\\$\\$[QT_INSTALL_LIBS]\" \"${_qt5_install_libs}\" _static_depends \"${_static_depends}\") foreach(_flag ${_static_depends}) @@ -79,10 +80,13 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura if(_flag MATCHES \"^-framework$\") # Handle the next flag as framework name set(_framework_flag 1) + elseif(_flag MATCHES \"^-F(.*)$\") + # Handle -F/foo/bar flags by recording the framework search paths to be used + # by find_library. + list(APPEND _fw_search_paths \"${CMAKE_MATCH_1}\") elseif(_framework_flag OR _flag MATCHES \"^-l(.*)$\") if(_framework_flag) # Handle Darwin framework bundles passed as -framework Foo - unset(_framework_flag) set(_lib ${_flag}) else() # Handle normal libraries passed as -lfoo @@ -100,8 +104,12 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura find_package(Threads REQUIRED) list(APPEND _lib_deps Threads::Threads) else() - if(_search_paths) - find_library(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH ${_lib} HINTS ${_search_paths} NO_DEFAULT_PATH) + set(current_search_paths \"${_search_paths}\") + if(_framework_flag) + set(current_search_paths \"${_fw_search_paths}\") + endif() + if(current_search_paths) + find_library(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH ${_lib} HINTS ${current_search_paths} NO_DEFAULT_PATH) endif() find_library(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH ${_lib}) mark_as_advanced(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH) @@ -112,6 +120,7 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura else() message(FATAL_ERROR \"Library not found: ${_lib}\") endif() + unset(_framework_flag) endif() elseif(EXISTS \"${_flag}\") # The flag is an absolute path to an existing library -- cgit v1.2.3 From 1749f9184b97e03753175c92af4a82d4ce577b40 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 13 Jan 2020 12:11:11 +0100 Subject: MinGW: Fix debug builds of applications Only expect debug Qt libs with 'd' suffix if Qt was configured with -debug-and-release. This partially amends 9b4ec1393f and 4d289edb1 . Fixes: QTBUG-81325 Change-Id: I56c8965272265cf0a91351aae29d648b8687ec77 Reviewed-by: Thiago Macieira Reviewed-by: Joerg Bornemann --- mkspecs/features/create_cmake.prf | 39 +++++++++++++++++++++++---------------- mkspecs/features/qt_functions.prf | 19 +++++++++++++++---- 2 files changed, 38 insertions(+), 20 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index 346fbf2467..4aa5dad467 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -212,21 +212,23 @@ contains(CONFIG, plugin) { CMAKE_PLUGIN_TYPE_ESCAPED = $$replace(PLUGIN_TYPE, [-/], _) win32 { + !mingw|qtConfig(debug_and_release): debug_suffix="d" + 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_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}$${debug_suffix}.dll CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.prl - CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.prl + CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}$${debug_suffix}.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_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}$${debug_suffix}.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 + CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}$${debug_suffix}.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_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}$${debug_suffix}.lib CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.prl - CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.prl + CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}$${debug_suffix}.prl } } else { mac { @@ -313,37 +315,42 @@ mac { CMAKE_WINDOWS_BUILD = "true" CMAKE_FIND_OTHER_LIBRARY_BUILD = "true" - CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.dll - CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.dll + !mingw|qtConfig(debug_and_release): debug_suffix="d" mingw { - CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqtmain$${QT_LIBINFIX}d.a + CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}$${debug_suffix}.dll + CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.dll + + CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqtmain$${QT_LIBINFIX}$${debug_suffix}.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_DEBUG = lib$${CMAKE_QT_STEM}$${debug_suffix}.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_DEBUG = lib$${CMAKE_QT_STEM}$${debug_suffix}.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_DEBUG = lib$${CMAKE_QT_STEM}$${debug_suffix}.a CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a } } else { - CMAKE_WINMAIN_FILE_LOCATION_DEBUG = qtmain$${QT_LIBINFIX}d.lib + CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}$${debug_suffix}.dll + CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.dll + + CMAKE_WINMAIN_FILE_LOCATION_DEBUG = qtmain$${QT_LIBINFIX}$${debug_suffix}.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_DEBUG = $${CMAKE_QT_STEM}$${debug_suffix}.lib CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib - CMAKE_PRL_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.prl + CMAKE_PRL_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}$${debug_suffix}.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_DEBUG = $${CMAKE_QT_STEM}$${debug_suffix}.lib CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib } } diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 45d4492788..32877dda89 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -2,10 +2,21 @@ defineReplace(qtPlatformTargetSuffix) { suffix = android: return($${suffix}_$${QT_ARCH}) - else: CONFIG(debug, debug|release) { - !debug_and_release|build_pass { - mac: return($${suffix}_debug) - win32: return($${suffix}d) + win32 { + CONFIG(debug, debug|release) { + mingw { + qtConfig(debug_and_release):build_pass: \ + return($${suffix}d) + } else { + !debug_and_release|build_pass: \ + return($${suffix}d) + } + } + } + macos { + CONFIG(debug, debug|release) { + !debug_and_release|build_pass: \ + return($${suffix}_debug) } } return($$suffix) -- cgit v1.2.3 From 0ab53fbdda2fd7f24f45dcd52fbd195e282554da Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 23 Jan 2020 10:01:14 +0100 Subject: Fix qtPlatformTargetSuffix for darwin platforms Commit 1749f918 changed a "mac" scope to a "macos" scope (thanks to the enormously helpful hint from in^Wsanity bot). Instead it should use "darwin", because that's what is equivalent to "mac". Fixes: QTBUG-81599 Change-Id: I0fd82f984945836a5b7b1bea5ed2117a2f676947 Reviewed-by: Kai Koehne --- mkspecs/features/qt_functions.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 32877dda89..7777e615bd 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -13,7 +13,7 @@ defineReplace(qtPlatformTargetSuffix) { } } } - macos { + darwin { CONFIG(debug, debug|release) { !debug_and_release|build_pass: \ return($${suffix}_debug) -- cgit v1.2.3