diff options
Diffstat (limited to 'mkspecs/features')
-rw-r--r-- | mkspecs/features/create_cmake.prf | 28 | ||||
-rw-r--r-- | mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 59 | ||||
-rw-r--r-- | mkspecs/features/exclusive_builds.prf | 9 | ||||
-rw-r--r-- | mkspecs/features/qt_docs.prf | 25 | ||||
-rw-r--r-- | mkspecs/features/qt_module.prf | 2 | ||||
-rw-r--r-- | mkspecs/features/qt_module_headers.prf | 1 | ||||
-rwxr-xr-x | mkspecs/features/uikit/devices.py | 10 | ||||
-rw-r--r-- | mkspecs/features/unsupported/testserver.prf | 4 |
8 files changed, 110 insertions, 28 deletions
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index 00da9bd33f..376a7ded5d 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -26,6 +26,10 @@ contains(CMAKE_INSTALL_LIBS_DIR, ^(/usr)?/lib(64)?.*): CMAKE_USR_MOVE_WORKAROUND CMAKE_OUT_DIR = $$MODULE_BASE_OUTDIR/lib/cmake +internal_module { + MODULE = "$${MODULE}_private" +} + # Core, Network, an external module named Foo CMAKE_MODULE_NAME = $$cmakeModuleName($${MODULE}) @@ -112,6 +116,10 @@ win32:!static:!staticlib { static|staticlib:CMAKE_STATIC_TYPE = true +internal_module { + CMAKE_INTERNAL_MODULE = true +} + CMAKE_DEBUG_TYPE = CMAKE_RELEASE_TYPE = @@ -133,6 +141,24 @@ equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe" if(build_all|CONFIG(debug, debug|release)): CMAKE_DEBUG_TYPE = debug if(build_all|CONFIG(release, debug|release)): CMAKE_RELEASE_TYPE = release +# CMAKE_DEBUG_AND_RELEASE is used to tell the _populate_$${CMAKE_MODULE_NAME}_target_properties +# functions whether a Configuration specific generator expression needs to be added to the values +# of INTERFACE_LINK_LIBRARIES and INTERFACE_LINK_OPTIONS. For debug_and_release builds, we do need +# configuration specific values. For singular builds (only release or only debug), we want the +# values to be applied regardless of the configuration. +# This would allow on Linux and macOS (and with a recent enough version of CMake on Windows) to +# build a Debug configuration of an application, even if Qt was built in a Release configuration. +# +# All IMPORTED_LOCATION_<CONFIG> paths are automatically considered by CMake if there is no +# <CONFIG> equivalent to the value specified by CMAKE_BUILD_TYPE. +# This means that when Qt was built in a Release configuration, and the application in a Debug +# configuration, IMPORTED_LOCATION_RELEASE will be used for the Qt libraries. +debug_and_release { + CMAKE_DEBUG_AND_RELEASE = TRUE +} else { + CMAKE_DEBUG_AND_RELEASE = FALSE +} + contains(CONFIG, plugin) { !isEmpty(PLUGIN_EXTENDS):!equals(PLUGIN_EXTENDS, -) { count(PLUGIN_EXTENDS, 1, greaterThan): \ @@ -341,7 +367,7 @@ cmake_qt5_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME} # Other modules should either create proper tests in tests/auto/cmake or, as # a temporary measure, disable the generation of cmake files # with 'CONFIG -= create_cmake' -!equals(CMAKE_MODULE_TESTS, -) { +!internal_module:!equals(CMAKE_MODULE_TESTS, -) { isEmpty(CMAKE_MODULE_TESTS): CMAKE_MODULE_TESTS = $$MODULE_BASE_INDIR/tests/auto/cmake !exists($$CMAKE_MODULE_TESTS): \ error("Missing CMake tests. Either create tests in tests/auto/cmake," \ diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index ba7d9575c0..d4fd057682 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -75,7 +75,7 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura # Handle normal libraries passed as -lfoo set(_lib \"${CMAKE_MATCH_1}\") foreach(_standard_library ${_standard_libraries}) - if(_standard_library MATCHES \"^${_lib}(\\.lib)?$\") + if(_standard_library MATCHES \"^${_lib}(\\\\.lib)?$\") set(_lib_is_default_linked TRUE) break() endif() @@ -119,7 +119,8 @@ endfunction() !!ENDIF !!IF !equals(TEMPLATE, aux) -macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION) +macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION + IsDebugAndRelease) set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) @@ -130,24 +131,48 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location}) set(_deps ${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES} + ) + set(_static_deps !!IF !isEmpty(CMAKE_STATIC_TYPE) ${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LIB_DEPENDENCIES} !!ENDIF ) + set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES - \"INTERFACE_LINK_LIBRARIES\" \"${_deps}\" \"IMPORTED_LOCATION_${Configuration}\" ${imported_location} !!IF !isEmpty(CMAKE_LIB_SONAME) \"IMPORTED_SONAME_${Configuration}\" \"$${CMAKE_LIB_SONAME}\" !!ENDIF # For backward compatibility with CMake < 2.8.12 - \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_deps}\" + \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_deps};${_static_deps}\" + ) + set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES + \"${_deps}\" ) + !!IF !isEmpty(CMAKE_STATIC_TYPE) + if(NOT "${IsDebugAndRelease}") + set(_genex_condition \"1\") + else() + if("${Configuration}" STREQUAL "DEBUG") + set(_genex_condition \"$<CONFIG:Debug>\") + else() + set(_genex_condition \"$<NOT:$<CONFIG:Debug>>\") + endif() + endif() - if(NOT CMAKE_VERSION VERSION_LESS \"3.13\") - set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES - \"INTERFACE_LINK_OPTIONS\" \"${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LINK_FLAGS}\" + if(_static_deps) + set(_static_deps_genex \"$<${_genex_condition}:${_static_deps}>\") + set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES + \"${_static_deps_genex}\" + ) + endif() + + set(_static_link_flags \"${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LINK_FLAGS}\") + if(NOT CMAKE_VERSION VERSION_LESS \"3.13\" AND _static_link_flags) + set(_static_link_flags_genex \"$<${_genex_condition}:${_static_link_flags}>\") + set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_OPTIONS + \"${_static_link_flags_genex}\" ) endif() !!ENDIF @@ -382,9 +407,9 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!IF !equals(TEMPLATE, aux) !!IF !isEmpty(CMAKE_RELEASE_TYPE) !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) - _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" $${CMAKE_DEBUG_AND_RELEASE}) !!ELSE - _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE}) !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) @@ -395,7 +420,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) !!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" $${CMAKE_DEBUG_AND_RELEASE}) !!ELSE // CMAKE_STATIC_WINDOWS_BUILD if (EXISTS !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) @@ -409,7 +434,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!ELSE \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) !!ENDIF - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE}) !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD endif() !!ENDIF // CMAKE_DEBUG_TYPE @@ -419,9 +444,9 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!IF !isEmpty(CMAKE_DEBUG_TYPE) !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" $${CMAKE_DEBUG_AND_RELEASE}) !!ELSE - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE}) !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) @@ -432,7 +457,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) !!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE - _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" $${CMAKE_DEBUG_AND_RELEASE}) !!ELSE // CMAKE_STATIC_WINDOWS_BUILD if (EXISTS !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) @@ -446,7 +471,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!ELSE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) !!ENDIF - _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) + _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE}) !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD endif() !!ENDIF // CMAKE_RELEASE_TYPE @@ -459,6 +484,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) ) !!ENDIF // TEMPLATE != aux +!!IF isEmpty(CMAKE_INTERNAL_MODULE) + file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*Plugin.cmake\") macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION) @@ -481,6 +508,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) endforeach() endif() +!!ENDIF // isEmpty(CMAKE_INTERNAL_MODULE) + !!IF !isEmpty(CMAKE_MODULE_EXTRAS) include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\") diff --git a/mkspecs/features/exclusive_builds.prf b/mkspecs/features/exclusive_builds.prf index b28e74146a..a41c5ab415 100644 --- a/mkspecs/features/exclusive_builds.prf +++ b/mkspecs/features/exclusive_builds.prf @@ -37,6 +37,9 @@ defineTest(addExclusiveBuilds) { addExclusiveBuildsProper($$join(ARGS, _and_), $$ARGS) } -# Default directories to process -QMAKE_DIR_REPLACE_SANE += QGLTF_DIR TRACEGEN_DIR QMLCACHE_DIR LRELEASE_DIR LEX_DIR YACC_DIR -QMAKE_DIR_REPLACE = OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR DESTDIR $$QMAKE_DIR_REPLACE_SANE +QMAKE_DEFAULT_DIRS_TO_PROCESS = QGLTF_DIR TRACEGEN_DIR QMLCACHE_DIR LRELEASE_DIR LEX_DIR YACC_DIR +QMAKE_DIR_REPLACE_SANE += $$QMAKE_DEFAULT_DIRS_TO_PROCESS +QMAKE_DIR_REPLACE = \ + OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR DESTDIR \ + $$QMAKE_DEFAULT_DIRS_TO_PROCESS +unset(QMAKE_DEFAULT_DIRS_TO_PROCESS) diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf index 3b74cd4dd5..deb4ac2829 100644 --- a/mkspecs/features/qt_docs.prf +++ b/mkspecs/features/qt_docs.prf @@ -27,6 +27,24 @@ QT_TOOL_ENV = qtver qtmver qtvertag qtdocs builddir qtPrepareTool(QDOC, qdoc) QT_TOOL_ENV = +# On Windows, put the includes into a .inc file which QDoc will read, if the project +# has too many includes. We do this to overcome a command-line limit on Windows. +WIN_INCLUDETEMP= +INCLUDE_PATHS=$$INCPATH +win32:count(INCLUDE_PATHS, 30, >) { + WIN_INCLUDETEMP = $$OUT_PWD/qdocincludepaths.inc + WIN_INCLUDETEMP_CONTENT = + for (inc, INCLUDE_PATHS): \ + WIN_INCLUDETEMP_CONTENT += -I$$inc + write_file($$absolute_path($$WIN_INCLUDETEMP, $$OUT_PWD), WIN_INCLUDETEMP_CONTENT)|error() +} + +isEmpty(WIN_INCLUDETEMP) { + QDOC_INCLUDE_PATHS=$(INCPATH) +} else { + QDOC_INCLUDE_PATHS=@$$shell_quote($$WIN_INCLUDETEMP) +} + !build_online_docs: qtPrepareTool(QHELPGENERATOR, qhelpgenerator) qtPrepareTool(QTATTRIBUTIONSSCANNER, qtattributionsscanner) @@ -75,12 +93,13 @@ qtattributionsscanner.CONFIG += phony QMAKE_EXTRA_TARGETS += qtattributionsscanner doc_command = $$QDOC $$QMAKE_DOCS + prepare_docs { - prepare_docs.commands += $$doc_command -prepare $$PREP_DOC_INDEXES -no-link-errors $(INCPATH) - generate_docs.commands += $$doc_command -generate $$DOC_INDEXES $(INCPATH) + prepare_docs.commands += $$doc_command -prepare $$PREP_DOC_INDEXES -no-link-errors $$QDOC_INCLUDE_PATHS + generate_docs.commands += $$doc_command -generate $$DOC_INDEXES $$QDOC_INCLUDE_PATHS prepare_docs.depends += qtattributionsscanner } else { - html_docs.commands += $$doc_command $$DOC_INDEXES $(INCPATH) + html_docs.commands += $$doc_command $$DOC_INDEXES $(QDOC_INCLUDE_PATHS) html_docs.depends += qtattributionsscanner } diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 24512eeb76..169d91c746 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -117,7 +117,7 @@ unset(QT_FOR_PRIVATE) QMAKE_USE_PRIVATE += $$QMAKE_USE_FOR_PRIVATE unset(QMAKE_USE_FOR_PRIVATE) -!internal_module:CONFIG += create_cmake +CONFIG += create_cmake contains(TARGET, QtAddOn.*): \ DEFINES += QT_BUILD_ADDON_$${ucmodule}_LIB diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 899a40103a..7ee1a956f4 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -304,7 +304,6 @@ headersclean:!internal_module { header_check.variable_out = PRE_TARGETDEPS header_check.name = headercheck ${QMAKE_FILE_IN} header_check.commands = $$hcleanCOMMAND - silent:header_check.commands = @echo compiling[header] ${QMAKE_FILE_IN} && $$hcleanCOMMAND QMAKE_EXTRA_COMPILERS += header_check } unset(hcleanCOMMAND) diff --git a/mkspecs/features/uikit/devices.py b/mkspecs/features/uikit/devices.py index 0443e838f2..8cdcb370a0 100755 --- a/mkspecs/features/uikit/devices.py +++ b/mkspecs/features/uikit/devices.py @@ -46,11 +46,17 @@ import json import subprocess from distutils.version import StrictVersion +def is_available(object): + if "isAvailable" in object: + return object["isAvailable"] # introduced in Xcode 11 + else: + return "unavailable" not in object["availability"] + def is_suitable_runtime(runtimes, runtime_name, platform, min_version): for runtime in runtimes: identifier = runtime["identifier"] if (runtime["name"] == runtime_name or identifier == runtime_name) \ - and "unavailable" not in runtime["availability"] \ + and is_available(runtime) \ and identifier.startswith("com.apple.CoreSimulator.SimRuntime.{}".format(platform)) \ and StrictVersion(runtime["version"]) >= min_version: return True @@ -77,6 +83,6 @@ if __name__ == "__main__": for runtime_name in device_dict: if is_suitable_runtime(runtimes, runtime_name, args.platform, args.minimum_deployment_target): for device in device_dict[runtime_name]: - if "unavailable" not in device["availability"] \ + if is_available(device) \ and (args.state is None or device["state"].lower() in args.state): print(device["udid"]) diff --git a/mkspecs/features/unsupported/testserver.prf b/mkspecs/features/unsupported/testserver.prf index 32bd4df30c..bca88ea2d8 100644 --- a/mkspecs/features/unsupported/testserver.prf +++ b/mkspecs/features/unsupported/testserver.prf @@ -58,9 +58,9 @@ debug_and_release:!build_pass: return() DOCKER_ENABLED = 1 -equals(QMAKE_HOST.os, Darwin) | equals(QMAKE_HOST.os, Windows) { +equals(QMAKE_HOST.os, Darwin) { DOCKER_ENABLED = 0 - message("Not using docker network test server on macOS and Windows, see QTQAINFRA-2717 and QTQAINFRA-2750") + message("Not using docker network test server on macOS, see QTQAINFRA-2717 and QTQAINFRA-2750") } TESTSERVER_VERSION = "" |