From b9a32351c8582ede87b6c63967f5c832c0622645 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 8 Sep 2016 13:54:44 -0700 Subject: findclasslist.pl: namespaces can be exported too You can place the export macros in the namespace declarations on ELF systems and that will apply to all declarations inside that scope. If a namespace is exported like that, then we should mark it for versioning too. Note that the exporting doesn't happen for declarations in other scopes of the same namespace, even though the findclasslist.pl script will mark everything in that namespace. This should not be a problem. Task-number: QTBUG-55897 Change-Id: I371f5b01e24a4d56b304fffd147274778b980ad2 Reviewed-by: Dmitry Shachnev Reviewed-by: Oswald Buddenhagen Reviewed-by: Frederik Gladhorn --- mkspecs/features/data/unix/findclasslist.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkspecs') diff --git a/mkspecs/features/data/unix/findclasslist.pl b/mkspecs/features/data/unix/findclasslist.pl index fb4357d0d4..b74b8b6a58 100644 --- a/mkspecs/features/data/unix/findclasslist.pl +++ b/mkspecs/features/data/unix/findclasslist.pl @@ -55,7 +55,7 @@ while () { my $comment = " /* $1 */"; while (my $line = ) { # Match a struct or class declaration, but not a forward declaration - $line =~ /^(?:struct|class) (?:Q_.*_EXPORT)? (\w+)(?!;)/ or next; + $line =~ /^(?:struct|class|namespace) (?:Q_.*_EXPORT)? (\w+)(?!;)/ or next; print $comment if $comment; printf " *%d%s*;\n", length $1, $1; $comment = 0; -- cgit v1.2.3 From 59985b3c291f769cfc24cf361367757fce229397 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 7 Oct 2016 20:16:58 +0200 Subject: fix xcodebuilds without -sdk iphonesimulator the order of the arguments passed to addExclusiveBuilds() determines the name of the CONFIG flag which actually enables the mode. that is historically fixed to iphonesimulator_and_iphoneos and we cannot just change the order. to get around this, add a new "overload" of the function which allows specifying the flag independently from the order of the builds, and make use of it in ios' resolve_config.prf. amends d2b4a789c. Change-Id: Ia3fabea0c0c30beae680b57e75bdcdf35ef6503d Reviewed-by: Jake Petroules --- mkspecs/features/exclusive_builds.prf | 18 +++++++++++------- mkspecs/macx-ios-clang/features/resolve_config.prf | 4 ++-- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/exclusive_builds.prf b/mkspecs/features/exclusive_builds.prf index 5d06198ae4..f40cc99172 100644 --- a/mkspecs/features/exclusive_builds.prf +++ b/mkspecs/features/exclusive_builds.prf @@ -1,12 +1,9 @@ -defineTest(addExclusiveBuilds) { - lessThan(ARGC, 2): \ - error("addExclusiveBuilds() requires at least two arguments") - - !$$join(ARGS, _and_):!fix_output_dirs: \ +defineTest(addExclusiveBuildsProper) { + !$$1:!fix_output_dirs: \ return(true) - for(build, ARGS) { + for(build, 2) { isEmpty($${build}.name) { $${build}.name = $$title($$build) export($${build}.name) @@ -20,7 +17,7 @@ defineTest(addExclusiveBuilds) { export($${build}.dir_affix) } - $${build}.exclusive = $$ARGS + $${build}.exclusive = $$2 export($${build}.exclusive) QMAKE_EXCLUSIVE_BUILDS += $$build @@ -33,6 +30,13 @@ defineTest(addExclusiveBuilds) { return(true) } +defineTest(addExclusiveBuilds) { + lessThan(ARGC, 2): \ + error("addExclusiveBuilds() requires at least two arguments") + + addExclusiveBuildsProper($$join(ARGS, _and_), $$ARGS) +} + # Default directories to process QMAKE_DIR_REPLACE = OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR QGLTF_DIR DESTDIR QMAKE_DIR_REPLACE_SANE += QGLTF_DIR diff --git a/mkspecs/macx-ios-clang/features/resolve_config.prf b/mkspecs/macx-ios-clang/features/resolve_config.prf index 64db2252cb..904296aea6 100644 --- a/mkspecs/macx-ios-clang/features/resolve_config.prf +++ b/mkspecs/macx-ios-clang/features/resolve_config.prf @@ -29,9 +29,9 @@ macx-xcode { # Switch the order to make sure that the first Makefile target is the right one !contains(QT_CONFIG, simulator_and_device):contains(QMAKE_MAC_SDK, ^iphonesimulator.*): \ - addExclusiveBuilds(iphonesimulator, iphoneos) + addExclusiveBuildsProper(iphonesimulator_and_iphoneos, iphonesimulator iphoneos) else: \ - addExclusiveBuilds(iphoneos, iphonesimulator) + addExclusiveBuildsProper(iphonesimulator_and_iphoneos, iphoneos iphonesimulator) } equals(TEMPLATE, subdirs) { -- cgit v1.2.3 From 9a3073a98d43faeb39827bba36040831215b04f0 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 10 Oct 2016 17:51:33 +0200 Subject: don't strip off plugin subtypes this code is meant to strip off the file name if provided (as the accessibility plugin in qtdeclarative does), but clearly overshot the mark by stripping the subtypes (as needed by qtmultimedia, and soon qtbase as well). use a stricter regexp which matches only names with an extension, which is a Good Enough (TM) approximation. Change-Id: I63afe9c7b1b0ebf4da530dcf558e9c84ae3c85ec Reviewed-by: Jake Petroules --- mkspecs/features/qt_module_pris.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 4dd9e25f9f..95b4b586a8 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -70,7 +70,7 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri else: \ module_config = !isEmpty(MODULE_PLUGIN_TYPES): \ - module_plugtypes = "QT.$${MODULE_ID}.plugin_types = $$replace(MODULE_PLUGIN_TYPES, /.*$, )" + module_plugtypes = "QT.$${MODULE_ID}.plugin_types = $$replace(MODULE_PLUGIN_TYPES, /[^.]+\\.[^.]+$, )" else: \ module_plugtypes = !isEmpty(MODULE_MASTER_HEADER): \ -- cgit v1.2.3 From d715667b206768677c18cd575ccd4f60c41a1091 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 10 Oct 2016 17:59:19 +0200 Subject: normalize name of plugin default linkage overrides QTPLUGIN. is better used with valid variable names, which is not the case when the plugin type contains slashes (plugin subtypes) or dashes (just so). normalize these chars to underscores. Change-Id: Icc93d952b93fef342e2fc93f20e9c5dd010dd734 Reviewed-by: Jake Petroules --- mkspecs/features/qt.prf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index 965b6cefc3..ddf99da303 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -290,7 +290,8 @@ contains(TEMPLATE, .*app) { autoplugs = for (qtmod, qt_module_deps) { for (ptype, QT.$${qtmod}.plugin_types) { - isEmpty(QTPLUGIN.$$ptype) { + nptype = $$replace(ptype, [-/], _) + isEmpty(QTPLUGIN.$$nptype) { for (plug, QT_PLUGINS) { equals(QT_PLUGIN.$${plug}.TYPE, $$ptype) { for (dep, QT_PLUGIN.$${plug}.EXTENDS) { @@ -303,7 +304,7 @@ contains(TEMPLATE, .*app) { } } } else { - plug = $$eval(QTPLUGIN.$$ptype) + plug = $$eval(QTPLUGIN.$$nptype) !equals(plug, -): \ autoplugs += $$plug } -- cgit v1.2.3 From fe8f387794853b0456f554a783e2769edab9aecb Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 21 Oct 2016 21:16:10 +0200 Subject: don't moc OBJECTIVE_SOURCES twice since 9ff1310af, the variable's contents are simply added to SOURCES, and the variable is not cleared. and qmake does not de-duplicate ... Task-number: QTBUG-53905 Change-Id: I3e551d21cbbd2d0cbfbf7aa7efaa5babac112f9d Reviewed-by: Jake Petroules --- mkspecs/features/moc.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkspecs') diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf index 8e8deec63c..9cc2bf3b76 100644 --- a/mkspecs/features/moc.prf +++ b/mkspecs/features/moc.prf @@ -56,7 +56,7 @@ moc_source.CONFIG = no_link moc_verify moc_source.dependency_type = TYPE_C moc_source.commands = ${QMAKE_FUNC_mocCmdBase} ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} moc_source.output = $$MOC_DIR/$${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_EXT_CPP_MOC} -moc_source.input = SOURCES OBJECTIVE_SOURCES +moc_source.input = SOURCES moc_source.name = MOC ${QMAKE_FILE_IN} moc_source.depends += $$WIN_INCLUDETEMP silent:moc_source.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_source.commands -- cgit v1.2.3 From d507cd40b6fc3b7271e3ba83c668f33b8aab8683 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 21 Oct 2016 21:18:58 +0200 Subject: unset OBJECTIVE_SOURCES and QMAKE_OBJECTIVE_CFLAGS after absorbing them this is a bit easier on the backwards compat code in qt creator, which needs to merge and then de-duplicate the lists itself. Change-Id: I79f9319c26af541f5efa85700878e7ddbd00e2b7 Reviewed-by: Jake Petroules --- mkspecs/features/mac/objective_c.prf | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mkspecs') diff --git a/mkspecs/features/mac/objective_c.prf b/mkspecs/features/mac/objective_c.prf index b3b1d4be99..ed1ad8ad38 100644 --- a/mkspecs/features/mac/objective_c.prf +++ b/mkspecs/features/mac/objective_c.prf @@ -1,6 +1,7 @@ # Objective-C/C++ sources go in SOURCES, like all other sources SOURCES += $$OBJECTIVE_SOURCES +unset(OBJECTIVE_SOURCES) # Strip C/C++ flags from QMAKE_OBJECTIVE_CFLAGS just in case QMAKE_OBJECTIVE_CFLAGS -= $$QMAKE_CFLAGS $$QMAKE_CXXFLAGS @@ -8,3 +9,4 @@ QMAKE_OBJECTIVE_CFLAGS -= $$QMAKE_CFLAGS $$QMAKE_CXXFLAGS # Add Objective-C/C++ flags to C/C++ flags, the compiler can handle it QMAKE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS QMAKE_CXXFLAGS += $$QMAKE_OBJECTIVE_CFLAGS +unset(QMAKE_OBJECTIVE_CFLAGS) -- cgit v1.2.3 From 78ee77f49122ac525590715a0a034965e3e59adf Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 4 Oct 2016 15:04:04 +0200 Subject: iOS: link photo lib plugin based on Info.plist contents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the application's Info.plist contains the key 'NSPhotoLibraryUsageDescription', we know that we can safely link in qiosnsphotolibrarysupport without violating AppStore requirements. This is a simple feature that doesn't introduce additional qmake API for doing app deployment with optional iOS QPA plugins. [ChangeLog][iOS] Starting from iOS 10, Apple requires all apps that need access to photos to have the key 'NSPhotoLibraryUsageDescription' in the Info.plist. Therefore, to get the same support in Qt (when, e.g., using a file dialog), the Info.plist assigned to QMAKE_INFO_PLIST will need this key as well. Change-Id: I7a93afe24b589cad96d5a1d9e2a155ad1671178a Reviewed-by: Tor Arne Vestbø Reviewed-by: Jake Petroules --- mkspecs/macx-ios-clang/features/default_post.prf | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mkspecs') diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf index 4c8a6eaae6..93e9e10ec3 100644 --- a/mkspecs/macx-ios-clang/features/default_post.prf +++ b/mkspecs/macx-ios-clang/features/default_post.prf @@ -80,3 +80,11 @@ macx-xcode { QMAKE_CXXFLAGS += $$arch_flags QMAKE_LFLAGS += $$arch_flags } + +!xcodebuild:equals(TEMPLATE, app):!isEmpty(QMAKE_INFO_PLIST) { + # Only link in photo library support if Info.plist contains + # NSPhotoLibraryUsageDescription. Otherwise it will be rejected from AppStore. + plist_path = $$absolute_path($$QMAKE_INFO_PLIST, $$_PRO_FILE_PWD_) + system("/usr/libexec/PlistBuddy -c 'Print NSPhotoLibraryUsageDescription' $$system_quote($$plist_path) &>/dev/null"): \ + QTPLUGIN += qiosnsphotolibrarysupport +} -- cgit v1.2.3