diff options
Diffstat (limited to 'mkspecs/features')
-rw-r--r-- | mkspecs/features/android/android_deployment_settings.prf | 16 | ||||
-rw-r--r-- | mkspecs/features/ltcg.prf | 6 | ||||
-rw-r--r-- | mkspecs/features/metatypes.prf | 20 | ||||
-rw-r--r-- | mkspecs/features/qml_plugin.prf | 5 | ||||
-rw-r--r-- | mkspecs/features/qt_configure.prf | 2 | ||||
-rw-r--r-- | mkspecs/features/resources.prf | 59 | ||||
-rw-r--r-- | mkspecs/features/resources_functions.prf | 63 | ||||
-rw-r--r-- | mkspecs/features/sanitizer.prf | 6 |
8 files changed, 114 insertions, 63 deletions
diff --git a/mkspecs/features/android/android_deployment_settings.prf b/mkspecs/features/android/android_deployment_settings.prf index 4d6101e297..e781eb024c 100644 --- a/mkspecs/features/android/android_deployment_settings.prf +++ b/mkspecs/features/android/android_deployment_settings.prf @@ -63,6 +63,22 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-embedded { QML_ROOT_PATH = $$_PRO_FILE_PWD_ FILE_CONTENT += " \"qml-root-path\": $$emitString($$QML_ROOT_PATH)," FILE_CONTENT += " \"stdcpp-path\": $$emitString($$ANDROID_STDCPP_PATH)," + !isEmpty(RESOURCES) { + # Make sure that qmake generated qrc files are accounted for + load(resources_functions) + qtFlattenResources() + for(resource, RESOURCES) { + contains(resource, ".*\\qmake_qmake_immediate.qrc$") { + # They will be created for each architecture, since they could be different + # we need to account for all of them + for (arch, ANDROID_ABIS): \ + rescopy += $$absolute_path("qmake_qmake_immediate.qrc", $$OUT_PWD/$$arch) + } else { + contains(resource, ".*\\.qrc$"): rescopy += $$absolute_path($$resource, $$_PRO_FILE_PWD_) + } + } + FILE_CONTENT += " \"qrcFiles\": $$emitString($$join(rescopy, ","))," + } FILE_CONTENT += "" FILE_CONTENT += " \"application-binary\": $$emitString($$TARGET)" FILE_CONTENT += "}" diff --git a/mkspecs/features/ltcg.prf b/mkspecs/features/ltcg.prf index 10d14dfe85..d81f340edd 100644 --- a/mkspecs/features/ltcg.prf +++ b/mkspecs/features/ltcg.prf @@ -1,6 +1,12 @@ static:no-static-ltcg { # Static library but no-static-ltcg enabled: skip LTCG } else: CONFIG(release, debug|release) { + separate_debug_info { + # Evaluate single-$ variable references that have no valid value at mkspec loading time + QMAKE_LFLAGS_LTCG_SEPARATE_DEBUG_INFO ~= s/\\$\\{/\$\$\{/ + eval(QMAKE_LFLAGS_LTCG += $$QMAKE_LFLAGS_LTCG_SEPARATE_DEBUG_INFO) + } + # We need fat object files when creating static libraries on some platforms # so the linker will know to load a particular object from the library # in the first place. On others, we have special ar and nm to create the symbol diff --git a/mkspecs/features/metatypes.prf b/mkspecs/features/metatypes.prf index 64387458ac..c2eb8d8659 100644 --- a/mkspecs/features/metatypes.prf +++ b/mkspecs/features/metatypes.prf @@ -1,5 +1,7 @@ qtPrepareTool(MOC_COLLECT_JSON, moc) +load(qt_build_paths) + QMAKE_MOC_OPTIONS += --output-json MOC_JSON_H_BASE = $${QMAKE_H_MOD_MOC} @@ -26,17 +28,25 @@ moc_json_source.variable_out = MOC_JSON_FILES MOC_COLLECT_JSON_OUTPUT = $$lower($$basename(TARGET))_metatypes.json -moc_collect_json.CONFIG += no_link combine +moc_collect_json.CONFIG += no_link combine target_predeps moc_collect_json.commands = $$MOC_COLLECT_JSON --collect-json -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} moc_collect_json.input = MOC_JSON_FILES moc_collect_json.output = $$MOC_COLLECT_JSON_OUTPUT moc_collect_json.name = Collect moc JSON output into central file install_metatypes { - do_install.path = $$[QT_INSTALL_LIBS]/metatypes - do_install.files = $$OUT_PWD/$$MOC_COLLECT_JSON_OUTPUT - prefix_build: INSTALLS += do_install - else: COPIES += do_install + do_install_metatypes.path = $$[QT_INSTALL_LIBS]/metatypes + do_install_metatypes.files = $$OUT_PWD/$$MOC_COLLECT_JSON_OUTPUT + prefix_build { + !isEmpty(MODULE_BASE_OUTDIR) { + metatypes_to_builddir.files = $$do_install_metatypes.files + metatypes_to_builddir.path = $$MODULE_BASE_OUTDIR/lib/metatypes + COPIES += metatypes_to_builddir + } + INSTALLS += do_install_metatypes + } else { + COPIES += do_install_metatypes + } } QMAKE_EXTRA_COMPILERS += moc_collect_json moc_json_header moc_json_source diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf index f1c5658b04..1b67435787 100644 --- a/mkspecs/features/qml_plugin.prf +++ b/mkspecs/features/qml_plugin.prf @@ -68,7 +68,10 @@ load(qt_common) # To regenerate run 'make qmltypes' which will update the plugins.qmltypes file in the source # directory. Then review and commit the changes made to plugins.qmltypes. # -!cross_compile { +# Due to the above mentioned drawbacks, there is a better mechanism available now: qmltyperegistrar +# can generate the .qmltypes files at compile time. It will do this when CONFIG += qmltypes is set. +# Therefore, don't try to generate the qmltypes files via qmlplugindump in that case. +!cross_compile:!qmltypes { qmlplugindump = qmlplugindump importpath.name = QML2_IMPORT_PATH importpath.value = diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index adac835c26..7ed1f7f03a 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -759,6 +759,8 @@ defineTest(qtConfLibrary_pkgConfig) { return(false) contains($${1}.libs, ".*\\.$${QMAKE_EXTENSION_STATICLIB}$") { qtRunLoggedCommand("$$pkg_config --static --libs $$args", libs)|return(false) + # Split by space + eval(libs = $$libs) !qtConfResolveLibs($${1}.libs, $$libs): \ return(false) } diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index fa8ff1fb58..ca95768de8 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -16,63 +16,8 @@ defineReplace(xml_escape) { return($$1) } -RESOURCES += qmake_immediate -for(resource, RESOURCES) { - # Regular case of user qrc file - contains(resource, ".*\\.qrc$"): \ - next() - - # Fallback for stand-alone files/directories - !defined($${resource}.files, var) { - !equals(resource, qmake_immediate) { - !exists($$absolute_path($$resource, $$_PRO_FILE_PWD_)): \ - warning("Failure to find: $$resource") - qmake_immediate.files += $$resource - OTHER_FILES *= $$resource - } - RESOURCES -= $$resource - next() - } - - resource_file = $$absolute_path($$RCC_DIR/qmake_$${resource}.qrc, $$OUT_PWD) - - isEmpty(BUILDS)|build_pass { - # Collection of files, generate qrc file - prefix = $$eval($${resource}.prefix) - isEmpty(prefix): \ - prefix = "/" - - resource_file_content = \ - "<!DOCTYPE RCC><RCC version=\"1.0\">" \ - "<qresource prefix=\"$$xml_escape($$prefix)\">" - - abs_base = $$absolute_path($$eval($${resource}.base), $$_PRO_FILE_PWD_) - - for(file, $${resource}.files) { - abs_path = $$absolute_path($$file, $$_PRO_FILE_PWD_) - files = $$files($$abs_path/*, true) - isEmpty(files): \ - files = $$abs_path - for (file, files) { - exists($$file/*): next() # exclude directories - alias = $$relative_path($$file, $$abs_base) - resource_file_content += \ - "<file alias=\"$$xml_escape($$alias)\">$$xml_escape($$file)</file>" - OTHER_FILES *= $$file - } - } - - resource_file_content += \ - "</qresource>" \ - "</RCC>" - - !write_file($$resource_file, resource_file_content): \ - error() - } - - RESOURCES -= $$resource - RESOURCES += $$resource_file -} +load(resources_functions) +qtFlattenResources() !isEmpty(RESOURCES):contains(TEMPLATE, .*lib):plugin:static { pluginBaseName = $$basename(TARGET) diff --git a/mkspecs/features/resources_functions.prf b/mkspecs/features/resources_functions.prf new file mode 100644 index 0000000000..f7fed9e524 --- /dev/null +++ b/mkspecs/features/resources_functions.prf @@ -0,0 +1,63 @@ +defineTest(qtFlattenResources) { + RESOURCES += qmake_immediate + for(resource, RESOURCES) { + # Regular case of user qrc file + contains(resource, ".*\\.qrc$"): \ + next() + + # Fallback for stand-alone files/directories + !defined($${resource}.files, var) { + !equals(resource, qmake_immediate) { + !exists($$absolute_path($$resource, $$_PRO_FILE_PWD_)): \ + warning("Failure to find: $$resource") + qmake_immediate.files += $$resource + OTHER_FILES *= $$resource + } + RESOURCES -= $$resource + next() + } + + resource_file = $$absolute_path($$RCC_DIR/qmake_$${resource}.qrc, $$OUT_PWD) + + isEmpty(BUILDS)|build_pass { + # Collection of files, generate qrc file + prefix = $$eval($${resource}.prefix) + isEmpty(prefix): \ + prefix = "/" + + resource_file_content = \ + "<!DOCTYPE RCC><RCC version=\"1.0\">" \ + "<qresource prefix=\"$$xml_escape($$prefix)\">" + + abs_base = $$absolute_path($$eval($${resource}.base), $$_PRO_FILE_PWD_) + + for(file, $${resource}.files) { + abs_path = $$absolute_path($$file, $$_PRO_FILE_PWD_) + files = $$files($$abs_path/*, true) + isEmpty(files): \ + files = $$abs_path + for (file, files) { + exists($$file/*): next() # exclude directories + alias = $$relative_path($$file, $$abs_base) + resource_file_content += \ + "<file alias=\"$$xml_escape($$alias)\">$$xml_escape($$file)</file>" + OTHER_FILES *= $$file + } + } + + resource_file_content += \ + "</qresource>" \ + "</RCC>" + + !write_file($$resource_file, resource_file_content): \ + error() + } + + RESOURCES -= $$resource + RESOURCES += $$resource_file + } + export(RESOURCES) + export(OTHER_FILES) + export(qmake_immediate.files) + return(true) +} diff --git a/mkspecs/features/sanitizer.prf b/mkspecs/features/sanitizer.prf index c7d72aec80..12ca1a17bd 100644 --- a/mkspecs/features/sanitizer.prf +++ b/mkspecs/features/sanitizer.prf @@ -42,6 +42,12 @@ sanitize_thread { QMAKE_LFLAGS += $$QMAKE_SANITIZE_THREAD_LFLAGS } +sanitize_fuzzer_no_link { + QMAKE_CFLAGS += $$QMAKE_SANITIZE_FUZZERNL_CFLAGS + QMAKE_CXXFLAGS += $$QMAKE_SANITIZE_FUZZERNL_CXXFLAGS + QMAKE_LFLAGS += $$QMAKE_SANITIZE_FUZZERNL_LFLAGS +} + sanitize_undefined { QMAKE_CFLAGS += $$QMAKE_SANITIZE_UNDEFINED_CFLAGS QMAKE_CXXFLAGS += $$QMAKE_SANITIZE_UNDEFINED_CXXFLAGS |