diff options
author | Liang Qi <liang.qi@qt.io> | 2016-10-01 22:15:55 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-10-01 22:15:55 +0200 |
commit | 3e949b75fd298a30fa4e8b281ecf21fcb038efbe (patch) | |
tree | 592bb2d6ca846a9d3aee66bc829d21ae8ba8c056 /mkspecs | |
parent | 4518345b80b0ee1101ecb0e7349728abd237aa6e (diff) | |
parent | d2b4a789c39eb770068b002d2bc9ceb764dedf3d (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
mkspecs/features/mac/default_pre.prf
mkspecs/macx-ios-clang/features/resolve_config.prf
qtbase.pro
Change-Id: I65b5ebca4942a4f295bdd4ac1568e5c347333aea
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/common/mac.conf | 2 | ||||
-rw-r--r-- | mkspecs/features/mac/asset_catalogs.prf | 109 | ||||
-rw-r--r-- | mkspecs/features/mac/default_pre.prf | 4 | ||||
-rw-r--r-- | mkspecs/features/mac/sdk.prf | 2 | ||||
-rw-r--r-- | mkspecs/macx-ios-clang/features/default_post.prf | 15 | ||||
-rw-r--r-- | mkspecs/macx-ios-clang/features/resolve_config.prf | 6 | ||||
-rw-r--r-- | mkspecs/win32-g++/qmake.conf | 1 |
7 files changed, 121 insertions, 18 deletions
diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf index b19b0853cb..78b939cc9e 100644 --- a/mkspecs/common/mac.conf +++ b/mkspecs/common/mac.conf @@ -31,6 +31,8 @@ QMAKE_LIBS_DYNLOAD = QMAKE_LIBS_OPENGL = -framework OpenGL -framework AGL QMAKE_LIBS_THREAD = +QMAKE_ACTOOL = actool + QMAKE_DSYMUTIL = dsymutil QMAKE_STRIP = strip QMAKE_STRIPFLAGS_LIB += -S -x diff --git a/mkspecs/features/mac/asset_catalogs.prf b/mkspecs/features/mac/asset_catalogs.prf new file mode 100644 index 0000000000..57d93d56d5 --- /dev/null +++ b/mkspecs/features/mac/asset_catalogs.prf @@ -0,0 +1,109 @@ +# QMAKE_ASSET_CATALOGS +# Paths to xcassets directories to be compiled +# +# QMAKE_ASSET_CATALOGS_BUILD_PATH +# Location which asset catalogs will be compiled to. +# If the current target is an app bundle, defaults to its Resources directory. +# Otherwise, this value must be set manually. +# +# QMAKE_ASSET_CATALOGS_APP_ICON +# Name of the icon resource in the asset catalogs that will be used as the app icon. +# Defaults to AppIcon. +# +# QMAKE_ASSET_CATALOGS_INSTALL_PATH +# Base path to install files to. Falls back to a path relative to the target install path, +# based on QMAKE_ASSET_CATALOGS_BUILD_PATH. + +!have_target|if(!build_pass:!isEmpty(BUILDS)): \ + return() + +!isEmpty(QMAKE_ASSET_CATALOGS) { + load(resolve_target) + + isEmpty(QMAKE_ASSET_CATALOGS_BUILD_PATH) { + !isEmpty(QMAKE_RESOLVED_BUNDLE):equals(TEMPLATE, app):app_bundle { + macos: \ + QMAKE_ASSET_CATALOGS_BUILD_PATH = $$QMAKE_RESOLVED_BUNDLE/Contents/Resources + else: \ + QMAKE_ASSET_CATALOGS_BUILD_PATH = $$QMAKE_RESOLVED_BUNDLE + } else { + error("QMAKE_ASSET_CATALOGS_BUILD_PATH must be set when using QMAKE_ASSET_CATALOGS.") + } + } + + QMAKE_ASSET_CATALOGS_BUILD_PATH = $$clean_path($$QMAKE_ASSET_CATALOGS_BUILD_PATH) + + macx-xcode { + !isEmpty(QMAKE_ASSET_CATALOGS_APP_ICON) { + asset_catalog_appicon.name = "ASSETCATALOG_COMPILER_APPICON_NAME" + asset_catalog_appicon.value = $$QMAKE_ASSET_CATALOGS_APP_ICON + QMAKE_MAC_XCODE_SETTINGS += asset_catalog_appicon + } + + asset_catalog_compiler.files = $$QMAKE_ASSET_CATALOGS + macos: asset_catalog_compiler.path = Contents/Resources + QMAKE_BUNDLE_DATA += asset_catalog_compiler + } else { + !isEmpty(QMAKE_ASSET_CATALOGS_APP_ICON) { + asset_catalog_app_icon_arg = \ + --app-icon $$shell_quote($$QMAKE_ASSET_CATALOGS_APP_ICON) + } + + asset_catalog_compiler.target = $$OUT_PWD/asset_catalog_compiler.Info.plist + asset_catalog_compiler.commands = $$shell_quote($$QMAKE_ACTOOL) \ + $$asset_catalog_app_icon_arg \ + --output-partial-info-plist $$shell_quote($$asset_catalog_compiler.target) \ + --platform $${version_identifier} \ + --minimum-deployment-target $${deployment_target} \ + --compile $$shell_quote($$QMAKE_ASSET_CATALOGS_BUILD_PATH) + + for (catalog, QMAKE_ASSET_CATALOGS) { + asset_catalog_compiler.commands += $${catalog} + asset_catalog_compiler.depends += $$files($$catalog/*, true) + } + + actool_output_files = $$system(\ + mkdir -p $$system_quote($$QMAKE_ASSET_CATALOGS_BUILD_PATH) && \ + /usr/libexec/PlistBuddy -c \'Print :com.apple.actool.compilation-results:output-files\' \ + /dev/stdin <<< $($${asset_catalog_compiler.commands} 2>/dev/null) | grep \'^ .*$\', lines) + + for (output_file, actool_output_files) { + !equals(output_file, $$asset_catalog_compiler.target): \ + actool_output_files_rel += $$relative_path($$output_file, $$QMAKE_ASSET_CATALOGS_BUILD_PATH) + } + + QMAKE_EXTRA_TARGETS += asset_catalog_compiler + PRE_TARGETDEPS += $$asset_catalog_compiler.target + + isEmpty(QMAKE_ASSET_CATALOGS_INSTALL_PATH) { + !isEmpty(target.path): \ + QMAKE_ASSET_CATALOGS_INSTALL_PATH = $${target.path}/ + QMAKE_ASSET_CATALOGS_INSTALL_PATH = $${QMAKE_ASSET_CATALOGS_INSTALL_PATH}$$relative_path(\ + $$QMAKE_ASSET_CATALOGS_BUILD_PATH, $$absolute_path($$DESTDIR, $$OUT_PWD)) + } + + for (ac_install_file, actool_output_files_rel) { + asset_catalogs_files.files += \ + $$QMAKE_ASSET_CATALOGS_BUILD_PATH/$$ac_install_file + } + contains(INSTALLS, target): asset_catalogs_files.depends += install_target + asset_catalogs_files.path = $$QMAKE_ASSET_CATALOGS_INSTALL_PATH + asset_catalogs_files.CONFIG += no_check_exist + INSTALLS += asset_catalogs_files + } +} else: macx-xcode { + # Backwards compatibility + for (bundle_data, QMAKE_BUNDLE_DATA) { + for (bundle_file, $${bundle_data}.files) { + !contains(bundle_file, .*\.xcassets$): next() + warning("*.xcassets in QMAKE_BUNDLE_DATA is deprecated. Use QMAKE_ASSET_CATALOGS instead.") + !exists($$absolute_path($$bundle_file/AppIcon.appiconset, $$_PRO_FILE_PWD_)): next() + + asset_catalog_appicon.name = "ASSETCATALOG_COMPILER_APPICON_NAME" + asset_catalog_appicon.value = "AppIcon" + QMAKE_MAC_XCODE_SETTINGS += asset_catalog_appicon + break() + } + !isEmpty(asset_catalog_appicon.name): break() + } +} diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf index 1190efed5d..db1022294a 100644 --- a/mkspecs/features/mac/default_pre.prf +++ b/mkspecs/features/mac/default_pre.prf @@ -1,4 +1,4 @@ -CONFIG = rez $$CONFIG +CONFIG = asset_catalogs rez $$CONFIG load(default_pre) isEmpty(QMAKE_XCODE_DEVELOPER_PATH) { @@ -33,6 +33,8 @@ isEmpty(QMAKE_TARGET_BUNDLE_PREFIX) { cache(QMAKE_TARGET_BUNDLE_PREFIX) } +QMAKE_ASSET_CATALOGS_APP_ICON = AppIcon + # Make the default debug info format for static debug builds # DWARF instead of DWARF with dSYM. This cuts down build times # for application debug builds significantly, as Xcode doesn't diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf index ab37b1740f..5e5c52dc93 100644 --- a/mkspecs/features/mac/sdk.prf +++ b/mkspecs/features/mac/sdk.prf @@ -37,7 +37,7 @@ QMAKE_INCDIR_OPENGL = $$sysrootified QMAKESPEC_NAME = $$basename(QMAKESPEC) # Resolve SDK version of various tools -for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_LINK QMAKE_LINK_SHLIB)) { +for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_LINK QMAKE_LINK_SHLIB QMAKE_ACTOOL)) { tool_variable = QMAKE_MAC_SDK.$${QMAKESPEC_NAME}.$${QMAKE_MAC_SDK}.$${tool} !isEmpty($$tool_variable) { $$tool = $$eval($$tool_variable) diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf index e5c78a0ea4..37964b688b 100644 --- a/mkspecs/macx-ios-clang/features/default_post.prf +++ b/mkspecs/macx-ios-clang/features/default_post.prf @@ -24,21 +24,6 @@ macx-xcode { ios_device_family.value = $$QMAKE_IOS_TARGETED_DEVICE_FAMILY QMAKE_MAC_XCODE_SETTINGS += ios_device_family - # If QMAKE_BUNDLE_DATA contains an asset catalog that includes an - # AppIcon.appiconset, we configure Xcode to use it for app icons. - for(bundle_data, QMAKE_BUNDLE_DATA) { - for(bundle_file, $${bundle_data}.files) { - !contains(bundle_file, .*\.xcassets$): next() - !exists($$absolute_path($$bundle_file/AppIcon.appiconset, $$_PRO_FILE_PWD_)): next() - - asset_catalog_appicon.name = "ASSETCATALOG_COMPILER_APPICON_NAME" - asset_catalog_appicon.value = "AppIcon" - QMAKE_MAC_XCODE_SETTINGS += asset_catalog_appicon - break() - } - !isEmpty(asset_catalog_appicon.name): break() - } - # Set up default 4-inch iPhone/iPod launch image so that our apps # support the full screen resolution of those devices. qmake_launch_image = Default-568h@2x.png diff --git a/mkspecs/macx-ios-clang/features/resolve_config.prf b/mkspecs/macx-ios-clang/features/resolve_config.prf index c3ab90f45e..a964ee3278 100644 --- a/mkspecs/macx-ios-clang/features/resolve_config.prf +++ b/mkspecs/macx-ios-clang/features/resolve_config.prf @@ -30,7 +30,11 @@ macx-xcode { QMAKE_MAC_XCODE_SETTINGS += library_suffix_simulator CONFIG *= xcode_dynamic_library_suffix } else { - addExclusiveBuilds(simulator, device) + # 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, ^$${simulator.sdk}.*): \ + addExclusiveBuilds(simulator, device) + else: \ + addExclusiveBuilds(device, simulator) } equals(TEMPLATE, subdirs) { diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf index c5f6353d39..6ed39745ae 100644 --- a/mkspecs/win32-g++/qmake.conf +++ b/mkspecs/win32-g++/qmake.conf @@ -50,6 +50,7 @@ QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE +QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD |