summaryrefslogtreecommitdiff
path: root/mkspecs
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-11-26 22:30:27 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-11-26 22:35:48 +0100
commit4a8273a6fc2e741e811cf5dabc9a3c240306cf7f (patch)
tree2148abc88f8543eecdc0b97b2dd92594836af9b2 /mkspecs
parent036c5db468164297d213764c59a4b59daa76d90a (diff)
parent1c2be58fecaff1de5f2849192eb712984ebd59bd (diff)
downloadqtbase-4a8273a6fc2e741e811cf5dabc9a3c240306cf7f.tar.gz
Merge remote-tracking branch 'origin/stable' into dev
For the conflicts in msvc_nmake.cpp the ifdefs are extended since we need to support windows phone in the target branch while it is not there in the current stable branch (as of Qt 5.2). Conflicts: configure qmake/generators/win32/msvc_nmake.cpp src/3rdparty/angle/src/libEGL/Surface.cpp src/angle/src/common/common.pri src/corelib/global/qglobal.h src/corelib/io/qstandardpaths.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxscreeneventhandler.h src/plugins/platforms/xcb/qglxintegration.h src/widgets/kernel/win.pri tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp tools/configure/configureapp.cpp Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/android-g++/qmake.conf1
-rw-r--r--mkspecs/features/android/android_deployment_settings.prf12
-rw-r--r--mkspecs/features/create_cmake.prf20
-rw-r--r--mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in16
-rw-r--r--mkspecs/features/dbuscommon.pri1
-rw-r--r--mkspecs/features/default_post.prf2
-rw-r--r--mkspecs/features/exclusive_builds.prf109
-rw-r--r--mkspecs/features/exclusive_builds_post.prf160
-rw-r--r--mkspecs/features/mac/default_post.prf11
-rw-r--r--mkspecs/features/mac/default_pre.prf12
-rw-r--r--mkspecs/features/mac/sdk.prf6
-rw-r--r--mkspecs/features/qfeatures.prf4
-rw-r--r--mkspecs/features/qt.prf63
-rw-r--r--mkspecs/features/qt_android_deps.prf13
-rw-r--r--mkspecs/features/qt_build_config.prf8
-rw-r--r--mkspecs/features/qt_common.prf3
-rw-r--r--mkspecs/features/qt_functions.prf136
-rw-r--r--mkspecs/features/qt_installs.prf7
-rw-r--r--mkspecs/features/qt_module.prf13
-rw-r--r--mkspecs/features/qt_module_pris.prf123
-rw-r--r--mkspecs/features/qt_tool.prf2
-rw-r--r--mkspecs/features/resolve_config.prf19
-rw-r--r--mkspecs/features/resolve_target.prf2
-rw-r--r--mkspecs/linux-icc/qmake.conf3
-rw-r--r--mkspecs/macx-clang-32/Info.plist.app2
-rw-r--r--mkspecs/macx-clang/Info.plist.app2
-rw-r--r--mkspecs/macx-g++-32/Info.plist.app2
-rw-r--r--mkspecs/macx-g++/Info.plist.app2
-rw-r--r--mkspecs/macx-g++40/Info.plist.app2
-rw-r--r--mkspecs/macx-g++42/Info.plist.app2
-rw-r--r--mkspecs/macx-icc/Info.plist.app2
-rwxr-xr-xmkspecs/macx-ios-clang/Info.plist.app2
-rw-r--r--mkspecs/macx-ios-clang/features/default_post.prf220
-rw-r--r--mkspecs/macx-ios-clang/features/default_pre.prf4
-rw-r--r--mkspecs/macx-ios-clang/features/qt.prf11
-rw-r--r--mkspecs/macx-llvm/Info.plist.app2
-rw-r--r--mkspecs/win32-msvc2005/qplatformdefs.h2
-rw-r--r--mkspecs/win32-msvc2013/qmake.conf2
38 files changed, 645 insertions, 358 deletions
diff --git a/mkspecs/android-g++/qmake.conf b/mkspecs/android-g++/qmake.conf
index 11d62a1efb..e3fa924e23 100644
--- a/mkspecs/android-g++/qmake.conf
+++ b/mkspecs/android-g++/qmake.conf
@@ -4,7 +4,6 @@ QMAKE_PLATFORM = android
QMAKE_COMPILER = gcc
CONFIG += android_install unversioned_soname android_deployment_settings
-DEFINES += QT_NO_PRINTER QT_NO_PRINTDIALOG
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
diff --git a/mkspecs/features/android/android_deployment_settings.prf b/mkspecs/features/android/android_deployment_settings.prf
index a903ed025d..5bc1fd14c9 100644
--- a/mkspecs/features/android/android_deployment_settings.prf
+++ b/mkspecs/features/android/android_deployment_settings.prf
@@ -47,18 +47,6 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-no-sdk {
!isEmpty(ANDROID_PACKAGE_SOURCE_DIR): \
FILE_CONTENT += " \"android-package-source-directory\": $$emitString($$ANDROID_PACKAGE_SOURCE_DIR),"
- !isEmpty(ANDROID_PACKAGE): \
- FILE_CONTENT += " \"android-package\": $$emitString($$ANDROID_PACKAGE),"
-
- !isEmpty(ANDROID_MINIMUM_VERSION): \
- FILE_CONTENT += " \"android-minimum-version\": $$ANDROID_MINIMUM_VERSION,"
-
- !isEmpty(ANDROID_TARGET_VERSION): \
- FILE_CONTENT += " \"android-target-version\": $$ANDROID_TARGET_VERSION,"
-
- !isEmpty(ANDROID_APP_NAME): \
- FILE_CONTENT += " \"android-app-name\": $$emitString($$ANDROID_APP_NAME),"
-
!isEmpty(ANDROID_EXTRA_LIBS): \
FILE_CONTENT += " \"android-extra-libs\": $$emitString($$join(ANDROID_EXTRA_LIBS, ",")),"
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
index 4643c3915c..19b26460a0 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
@@ -51,7 +51,7 @@ contains(CMAKE_INCLUDE_DIR, "^\\.\\./.*") {
CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
}
-!exists($$first(QT.$${MODULE}.private_includes)): CMAKE_NO_PRIVATE_INCLUDES = true
+!exists($$first(QT.$${MODULE}_private.includes)): CMAKE_NO_PRIVATE_INCLUDES = true
CMAKE_LIB_DIR = $$cmakeRelativePath($$[QT_INSTALL_LIBS], $$[QT_INSTALL_PREFIX])
contains(CMAKE_LIB_DIR,"^\\.\\./.*") {
@@ -111,15 +111,15 @@ if(build_all|CONFIG(debug, debug|release)): CMAKE_DEBUG_TYPE = debug
if(build_all|CONFIG(release, debug|release)): CMAKE_RELEASE_TYPE = release
contains(CONFIG, plugin) {
- equals(PLUGIN_TYPE, bearer): PLUGIN_MODULE_NAME = network
- else:equals(PLUGIN_TYPE, sqldrivers): PLUGIN_MODULE_NAME = sql
- else:equals(PLUGIN_TYPE, accessible): PLUGIN_MODULE_NAME = widgets
- else:equals(PLUGIN_TYPE, imageformats): PLUGIN_MODULE_NAME = gui
- else:equals(PLUGIN_TYPE, platforminputcontexts): PLUGIN_MODULE_NAME = gui
- else:equals(PLUGIN_TYPE, platformthemes): PLUGIN_MODULE_NAME = gui
- else:equals(PLUGIN_TYPE, generic): PLUGIN_MODULE_NAME = gui
- else:equals(PLUGIN_TYPE, platforms): PLUGIN_MODULE_NAME = gui
- else: return()
+ PLUGIN_MODULE_NAME =
+ for (mod, QT_MODULES) {
+ types = $$replace(QT.$${mod}.plugin_types, /.*$, )
+ contains(types, $$PLUGIN_TYPE) {
+ PLUGIN_MODULE_NAME = $$mod
+ break()
+ }
+ }
+ isEmpty(PLUGIN_MODULE_NAME): return()
CMAKE_MODULE_NAME = $$cmakeModuleName($$PLUGIN_MODULE_NAME)
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index 0cdaafee7f..dce981e059 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -95,7 +95,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
)
!!ELSE
- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
+ set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
!!ENDIF
!!ELSE
!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
@@ -106,7 +106,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\"
)
!!ELSE
- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
+ set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
!!ENDIF
!!ELSE
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_INCLUDE_DIR}Qt$${CMAKE_MODULE_NAME}\")
@@ -116,7 +116,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
\"$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\"
)
!!ELSE
- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
+ set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
!!ENDIF
!!ENDIF
!!ENDIF
@@ -124,8 +124,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
include(\"${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake\" OPTIONAL)
!!ENDIF
!!ELSE
- set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS)
- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
+ set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"\")
+ set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
!!ENDIF
foreach(_dir ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS})
@@ -163,6 +163,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
set(_Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT EXACT)
endif()
+ set(Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS \"\")
+
foreach(_module_dep ${_Qt5$${CMAKE_MODULE_NAME}_MODULE_DEPENDENCIES})
if (NOT Qt5${_module_dep}_FOUND)
find_package(Qt5${_module_dep}
@@ -188,9 +190,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS)
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS)
- if (Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS)
- list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS)
- endif()
+ list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS)
set(_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES \"$${CMAKE_QT5_MODULE_DEPS}\")
diff --git a/mkspecs/features/dbuscommon.pri b/mkspecs/features/dbuscommon.pri
index 6e1e5659c3..2f2e6b831f 100644
--- a/mkspecs/features/dbuscommon.pri
+++ b/mkspecs/features/dbuscommon.pri
@@ -67,6 +67,7 @@ for(group, groups) {
$${group}_source.name = DBUSXML2CPP $${dbus_TYPE} SOURCE ${QMAKE_FILE_IN}
$${group}_source.variable_out = SOURCES
$${group}_source.input = $$input_list
+ $${group}_source.depends = $$eval($${group}_header.output) # this actually belongs to the object file
$${group}_moc.commands = $$moc_header.commands
$${group}_moc.output = $$moc_header.output
diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
index 4501b2a568..8eb7101acc 100644
--- a/mkspecs/features/default_post.prf
+++ b/mkspecs/features/default_post.prf
@@ -6,6 +6,8 @@ contains(TEMPLATE, ".*(lib|app)"):CONFIG += have_target
load(resolve_config)
+exclusive_builds: load(exclusive_builds_post)
+
# If the TARGET looks like a path, split it into DESTDIR and the resulting TARGET
target_dir_part = $$dirname(TARGET)
!isEmpty(target_dir_part) {
diff --git a/mkspecs/features/exclusive_builds.prf b/mkspecs/features/exclusive_builds.prf
index c45ff22c06..4d88dcd15e 100644
--- a/mkspecs/features/exclusive_builds.prf
+++ b/mkspecs/features/exclusive_builds.prf
@@ -1,92 +1,37 @@
-# fixExclusiveOutputDirs(1config, 2config)
-# Change all output paths that references 2config to have the string 1config in them
-defineTest(fixExclusiveOutputDirs) {
- firstBuild = $$1
- secondBuild = $$2
- count(ARGS, 2, greaterThan):isEqual($$list($$lower($$3)), false):appendFirstBuild = false
- else:appendFirstBuild = true
- isEmpty(QMAKE_DIR_REPLACE):QMAKE_DIR_REPLACE += OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR
- lessThan(firstBuild, $$secondBuild):eval($${firstBuild}_and_$${secondBuild}_target:QMAKE_DIR_REPLACE += DESTDIR)
- else:eval($${secondBuild}_and_$${firstBuild}_target:QMAKE_DIR_REPLACE += DESTDIR)
- for(fix, QMAKE_DIR_REPLACE) {
- isEmpty($$fix)|isEqual($$fix, .) {
- eval($$fix = $${firstBuild})
- } else:contains($$list($$first($$fix)), .*$${secondBuild}.*) {
- eval($$fix ~= s/$${secondBuild}/$${firstBuild}/gi)
- } else:isEqual(appendFirstBuild, true):!contains($$list($$first($$fix)), .*$${firstBuild}.*) {
- contains($$list($${first($$fix)}), .*/$):eval($$fix = $${first($$fix)}$${firstBuild})
- else:eval($$fix = $${first($$fix)}-$${firstBuild})
- }
- export($$fix)
- }
- return(true)
-}
-
-# addExclusiveBuilds(1config, 1name, 2config, 2name)
-# Adds two BUILDS which are exclusive to each other.
defineTest(addExclusiveBuilds) {
- firstBuild = $$1
- firstBuildName = $$2
- secondBuild = $$3
- secondBuildName = $$4
+ lessThan(ARGC, 2): \
+ error("addExclusiveBuilds() requires at least two arguments")
- contains(TEMPLATE, subdirs) {
- eval(sub_$${firstBuildName}.target = $$firstBuild)
- export(sub_$${firstBuildName}.target)
- eval(sub_$${firstBuildName}.CONFIG = recursive)
- export(sub_$${firstBuildName}.CONFIG)
- eval(sub_$${secondBuildName}.target = $$secondBuild)
- export(sub_$${secondBuildName}.target)
- eval(sub_$${secondBuildName}.CONFIG = recursive)
- export(sub_$${secondBuildName}.CONFIG)
- QMAKE_EXTRA_TARGETS += sub_$${firstBuildName} sub_$${secondBuildName}
- export(QMAKE_EXTRA_TARGETS)
- } else:!build_pass {
- first_BUILDS =
- second_BUILDS =
- suffix_BUILDS = Build
+ !$$join(ARGS, _and_):!fix_output_dirs: \
+ return(true)
- isEmpty(BUILDS): BUILDPERMUTATIONS = $$suffix_BUILDS
- else: BUILDPERMUTATIONS = $$BUILDS
+ for(build, ARGS) {
+ isEmpty($${build}.name) {
+ $${build}.name = $$title($$build)
+ export($${build}.name)
+ }
+ isEmpty($${build}.target) {
+ $${build}.target = $$lower($$build)
+ export($${build}.target)
+ }
+ isEmpty($${build}.dir_affix) {
+ $${build}.dir_affix = $$lower($$build)
+ export($${build}.dir_affix)
+ }
- for(permutation, BUILDPERMUTATIONS) {
- permutation ~= s/$${suffix_BUILDS}$//
- isEmpty(permutation): permutationName =
- else: permutationName = -$$permutation
- # Makefile target rule
- eval($${firstBuildName}$${permutation}.target = $${firstBuild}$$lower($${permutationName}))
- export($${firstBuildName}$${permutation}.target)
- # IDE name
- eval($${firstBuildName}$${permutation}.name = $${firstBuildName}$${permutationName})
- export($${firstBuildName}$${permutation}.name)
- # prl import CONFIG option
- eval($${firstBuildName}$${permutation}.PRL_CONFIG = $${firstBuild}$${permutation})
- export($${firstBuildName}$${permutation}.PRL_CONFIG)
- # Individual CONFIG option
- eval($${firstBuildName}$${permutation}.CONFIG = $${firstBuild} $${firstBuildName}Build $$eval($${permutation}.CONFIG))
- export($${firstBuildName}$${permutation}.CONFIG)
+ $${build}.exclusive = $$ARGS
+ export($${build}.exclusive)
- eval($${secondBuildName}$${permutation}.target = $${secondBuild}$$lower($${permutationName}))
- export($${secondBuildName}$${permutation}.target)
- eval($${secondBuildName}$${permutation}.name = $${secondBuildName}$${permutationName})
- export($${secondBuildName}$${permutation}.name)
- eval($${secondBuildName}$${permutation}.PRL_CONFIG = $${secondBuild}$${permutation})
- export($${secondBuildName}$${permutation}.PRL_CONFIG)
- eval($${secondBuildName}$${permutation}.CONFIG = $${secondBuild} $${secondBuildName}Build $$eval($${permutation}.CONFIG))
- export($${secondBuildName}$${permutation}.CONFIG)
+ QMAKE_EXCLUSIVE_BUILDS += $$build
+ }
- first_BUILDS += $${firstBuildName}$${permutation}
- second_BUILDS += $${secondBuildName}$${permutation}
- }
+ CONFIG *= exclusive_builds
+ export(CONFIG)
- # A mutual exclusive block.
- CONFIG($${firstBuild}, $${firstBuild}|$${secondBuild}): BUILDS = $$first_BUILDS $$second_BUILDS
- else: BUILDS = $$second_BUILDS $$first_BUILDS
- export(BUILDS)
- } else {
- eval($${firstBuildName}Build:fixExclusiveOutputDirs($$firstBuild, $$secondBuild, false))
- eval($${secondBuildName}Build:fixExclusiveOutputDirs($$secondBuild, $$firstBuild, false))
- }
+ export(QMAKE_EXCLUSIVE_BUILDS)
return(true)
}
+
+# Default directories to process
+QMAKE_DIR_REPLACE = OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR DESTDIR
diff --git a/mkspecs/features/exclusive_builds_post.prf b/mkspecs/features/exclusive_builds_post.prf
new file mode 100644
index 0000000000..936085af0b
--- /dev/null
+++ b/mkspecs/features/exclusive_builds_post.prf
@@ -0,0 +1,160 @@
+
+contains(TEMPLATE, subdirs) {
+ for(build, QMAKE_EXCLUSIVE_BUILDS) {
+ prepareRecursiveTarget($$build)
+ QMAKE_EXTRA_TARGETS += $$build
+ }
+} else {
+ # Recursively combines a list of exclusive builds into combinations
+ # of non-exclusive builds (separated by a ':' character), eg the
+ # list [debug, release, static, shared] will result in the four
+ # combinations [debug:static, debug:shared, release:static,
+ # release:shared].
+ defineReplace(combineExclusiveBuilds) {
+ permutationBuilds = $$1
+ existingBuilds = $$2
+
+ isEmpty(permutationBuilds): \
+ # Exit-condition, no more recursing
+ return($$existingBuilds)
+
+ # Choose the first build of the permutations and use the set of exclusive
+ # builds associated with that build as the list of existing builds. This
+ # partitions the permutations into one set of exclusive builds + the rest
+ # of the unknown permutations.
+ newExistingBuilds = $$eval($$first(permutationBuilds).exclusive)
+ permutationBuilds -= $$newExistingBuilds
+
+ # Recursively compute the combination of these two sets
+ recursiveCombination = $$combineExclusiveBuilds($$permutationBuilds, $$newExistingBuilds)
+
+ isEmpty(existingBuilds): \
+ # No need to combine further
+ return($$recursiveCombination)
+
+ result =
+ for(existingBuild, existingBuilds) {
+ for(combination, recursiveCombination): \
+ result += "$${existingBuild}:$${combination}"
+ }
+ return($$result)
+ }
+
+ buildCombinations = $$combineExclusiveBuilds($$QMAKE_EXCLUSIVE_BUILDS)
+
+ for(combination, buildCombinations) {
+ builds = $$split(combination, :)
+ key =
+ config =
+ target =
+ priority =
+ for(build, builds) {
+ key = $${key}$$eval($${build}.name)
+ config *= $$eval($${build}.CONFIG) $${build} $$eval($${build}.name)Build
+ target += $$eval($${build}.target)
+
+ # If a build has been prioritized through CONFIG we prefer that
+ CONFIG($$build, $$join($${build}.exclusive, |)): \
+ priority += 1
+ }
+
+ $${key}.name = $$key
+ $${key}.target = $$join(target, -)
+ $${key}.CONFIG = $$config
+ $${key}.builds = $$builds
+
+ BUILDS.$$size(priority) += $$key
+
+ # Add makefile targets for each exclusive build that will aggregate all targets
+ # that include the exclusive build. This matches the targets in the SUBDIR files
+ # so that you can recursivly build a single exclusive build.
+ !build_pass:count(builds, 1, >) {
+ for(build, builds) {
+ $${build}.depends += $$eval($${key}.target)
+ QMAKE_EXTRA_TARGETS *= $$build
+ }
+ }
+ }
+
+ BUILDS =
+ priority =
+ for(ever) {
+ # Keep the order in BUILDS matching the priority from CONFIG, so that the first
+ # entry in BUILDS will be the first/default target when not CONFIG(build_all).
+ BUILDS = $$eval(BUILDS.$$size(priority)) $$BUILDS
+ count(BUILDS, $$size(buildCombinations), >=): break()
+ priority += 1
+ }
+
+ build_pass|fix_output_dirs {
+ !build_pass {
+ # The builds are sorted by priority based on the current config
+ # so choosing the first one gives us the most appropriate build.
+ BUILD_PASS = $$first(BUILDS)
+ }
+
+ for(dir, QMAKE_DIR_REPLACE) {
+
+ # Limit builds to ones that should affect the current $$dir
+ builds =
+ for(build, $${BUILD_PASS}.builds) {
+ equals(dir, DESTDIR) {
+ !$$join($${build}.exclusive, _and_)_target: \
+ next()
+ }
+
+ builds += $$build
+ }
+
+ isEmpty(builds): \
+ next()
+
+ affixes =
+ for(build, builds): \
+ affixes += $$eval($${build}.dir_affix)
+ full_dir_affix = $$join(affixes, -)
+
+ isEmpty($$dir)|isEqual($$dir, .) {
+ # Use affix directly
+ $$dir = $$full_dir_affix
+ next()
+ }
+
+ contains(QMAKE_DIR_REPLACE_SANE, $$dir) {
+ # Suffix output dir
+ $$dir = $$clean_path($$eval($$dir)/$$full_dir_affix)
+ } else {
+ # "Compatibility mode" with QTBUG-491
+ for(build, builds) {
+ did_replace = false
+ build_affix = $$eval($${build}.dir_affix)
+ for(exclusive, $${build}.exclusive) {
+ equals(exclusive, $$build): \
+ next()
+
+ exclusive_affix = $$eval($${exclusive}.dir_affix)
+ contains($$dir, .*$${exclusive_affix}.*) {
+ $$dir ~= s/$${exclusive_affix}/$${build_affix}/gi
+ did_replace = true
+ }
+ }
+ $$did_replace: next()
+
+ # Append (as subdir or as suffix)
+ !build_pass {
+ dir_affix = $$eval($${build}.dir_affix)
+ !contains($$dir, .*$${dir_affix}.*) {
+ contains($$dir, .*/$) {
+ # Subdir
+ $$dir = $$eval($$dir)$$dir_affix
+ } else {
+ # Suffix
+ $$dir = $$eval($$dir)-$${dir_affix}
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index b183814e63..c3addf9319 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -19,13 +19,10 @@ qt:!isEmpty(QT_CONFIG) {
contains(QT_CONFIG, static):contains(QT_CONFIG, c++11): CONFIG += c++11
}
-isEmpty(_QMAKE_CACHE_) {
- warning("No .qmake.cache is present. This significantly slows down qmake with this makespec.")
- warning("Call 'cache()' in the top-level project file to rectify this problem.")
-} else {
- cache(QMAKE_XCODE_DEVELOPER_PATH)
- cache(QMAKE_XCODE_VERSION)
-}
+cache(QMAKE_XCODE_DEVELOPER_PATH, stash)
+cache(QMAKE_XCODE_VERSION, stash)
+
+QMAKE_XCODE_LIBRARY_SUFFIX = $$qtPlatformTargetSuffix()
# Ensure that we process sdk.prf first, as it will update QMAKE_CXX
# and friends that other features/extra compilers may depend on.
diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
index c0596d5ef0..c031403930 100644
--- a/mkspecs/features/mac/default_pre.prf
+++ b/mkspecs/features/mac/default_pre.prf
@@ -24,8 +24,16 @@ isEmpty(QMAKE_XCODE_VERSION) {
unset(xcode_version)
}
-# These two variables are used by the xcode_dynamic_library_suffix
+isEmpty(QMAKE_TARGET_BUNDLE_PREFIX) {
+ QMAKE_XCODE_PREFERENCES_FILE = $$(HOME)/Library/Preferences/com.apple.dt.Xcode.plist
+ exists($$QMAKE_XCODE_PREFERENCES_FILE): \
+ QMAKE_TARGET_BUNDLE_PREFIX = $$system("/usr/libexec/PlistBuddy -c 'print IDETemplateOptions:bundleIdentifierPrefix' $$QMAKE_XCODE_PREFERENCES_FILE 2>/dev/null")
+
+ !isEmpty(_QMAKE_CACHE_):!isEmpty(QMAKE_TARGET_BUNDLE_PREFIX): \
+ cache(QMAKE_TARGET_BUNDLE_PREFIX)
+}
+
+# This variable is used by the xcode_dynamic_library_suffix
# feature, which allows Xcode to choose the Qt libraries to link to
# at build time, depending on the current Xcode SDK and configuration.
-QMAKE_XCODE_LIBRARY_SUFFIX = $$qtPlatformTargetSuffix()
QMAKE_XCODE_LIBRARY_SUFFIX_SETTING = QT_LIBRARY_SUFFIX
diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
index 788fa5b362..5b5186a14b 100644
--- a/mkspecs/features/mac/sdk.prf
+++ b/mkspecs/features/mac/sdk.prf
@@ -8,7 +8,7 @@ contains(QMAKE_MAC_SDK, .*/.*): \
isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path) {
QMAKE_MAC_SDK_PATH = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version Path 2>/dev/null")
isEmpty(QMAKE_MAC_SDK_PATH): error("Could not resolve SDK path for \'$$QMAKE_MAC_SDK\'")
- !isEmpty(_QMAKE_CACHE_): cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path, set, QMAKE_MAC_SDK_PATH)
+ cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path, set stash, QMAKE_MAC_SDK_PATH)
} else {
QMAKE_MAC_SDK_PATH = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path)
}
@@ -41,7 +41,7 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_
isEmpty(sysrooted): next()
$$tool = $$sysrooted $$member(value, 1, -1)
- !isEmpty(_QMAKE_CACHE_): cache($$tool_variable, set, $$tool)
+ cache($$tool_variable, set stash, $$tool)
}
isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name) {
@@ -52,7 +52,7 @@ isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name) {
"sed 's/.*Value: \\(.*\\)/\\1/'")
isEmpty(QMAKE_MAC_PLATFORM_NAME): error("Could not resolve platform name for SDK '$$QMAKE_MAC_SDK'")
- !isEmpty(_QMAKE_CACHE_): cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name, set, QMAKE_MAC_PLATFORM_NAME)
+ cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name, set stash, QMAKE_MAC_PLATFORM_NAME)
} else {
QMAKE_MAC_PLATFORM_NAME = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name)
}
diff --git a/mkspecs/features/qfeatures.prf b/mkspecs/features/qfeatures.prf
new file mode 100644
index 0000000000..15ef5c5be0
--- /dev/null
+++ b/mkspecs/features/qfeatures.prf
@@ -0,0 +1,4 @@
+# This file needs to be loaded explicitly, as the evaluation is relatively
+# expensive, and not many projects will actually need it.
+QMAKE_QT_FEATURES = $$[QT_HOST_DATA/get]/mkspecs/qfeatures.pri
+include($$QMAKE_QT_FEATURES) | error("Failed to load $$QMAKE_QT_FEATURES")
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index 04375d4ce1..83a8778654 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -62,7 +62,7 @@ qaxserver {
unset(using_privates)
qtAddModules(QT, LIBS)
qtAddModules(QT_PRIVATE, LIBS_PRIVATE)
-!isEmpty(using_privates):!auto_use_privates:!no_private_qt_headers_warning:if(!debug_and_release|!build_pass) {
+!isEmpty(using_privates):!no_private_qt_headers_warning:if(!debug_and_release|!build_pass) {
message("This project is using private headers and will therefore be tied to this specific Qt module build version.")
message("Running this project against other versions of the Qt modules may crash at any arbitrary point.")
message("This is not a bug, but a result of using Qt internals. You have been warned!")
@@ -74,13 +74,16 @@ wince*:static:gui {
}
# static builds: link qml import plugins into the app.
-if(contains(QT, qml)|contains(QT_PRIVATE, qml)): \
+qt_module_deps = $$QT $$QT_PRIVATE
+qt_module_deps = $$replace(qt_module_deps, -private$, _private)
+qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
+contains(qt_module_deps, qml): \
contains(QT_CONFIG, static):contains(TEMPLATE, .*app):!host_build:!no_import_scan {
# run qmlimportscanner
qtPrepareTool(QMLIMPORTSCANNER, qmlimportscanner)
for (MODULE, QT_MODULES) {
PATH = $$eval(QT.$${MODULE}.qml)
- !isEmpty(PATH): QMLPATHS += $$PATH
+ !isEmpty(PATH):exists($$PATH): QMLPATHS += $$PATH
}
QMLPATHS = $$unique(QMLPATHS)
for (QMLPATH, QMLPATHS): \
@@ -96,7 +99,7 @@ if(contains(QT, qml)|contains(QT_PRIVATE, qml)): \
for (key, IMPORTS._KEYS_): {
PATH = $$eval(IMPORTS.$${key}.path)
PLUGIN = $$eval(IMPORTS.$${key}.plugin)
- !isEmpty(PATH):!isEmpty(PLUGIN): LIBS *= -L$$PATH -l$$PLUGIN
+ !isEmpty(PATH):!isEmpty(PLUGIN): LIBS *= -L$$PATH -l$${PLUGIN}$$qtPlatformTargetSuffix()
}
# create qml_plugin_import.cpp
@@ -124,33 +127,37 @@ if(contains(QT, qml)|contains(QT_PRIVATE, qml)): \
QMAKE_CLEAN += $$QML_IMPORT_CPP
# copy qml files. this part is platform spesific.
- macx {
- # copy to Contents/Resources in the bundle.
- QmlImports.path = Contents/Resources/
- QmlImports.files *= $$QMLPATHS
- QMAKE_BUNDLE_DATA += QmlImports
+ mac {
+ osx {
+ # Note: user can override QMAKE_BUNDLE_QML from pro file to change target bundle path
+ isEmpty(QMAKE_QML_BUNDLE_PATH):QMAKE_QML_BUNDLE_PATH = "Resources/qt_qml"
+ qmlTargetPath = $$OUT_PWD/$${TARGET}.app/Contents/$$QMAKE_QML_BUNDLE_PATH
+ qtconfTargetPath = $$OUT_PWD/$${TARGET}.app/Contents/Resources/qt.conf
+ } else {
+ # iOS: flat bundle layout (no Contents/Resources)
+ isEmpty(QMAKE_QML_BUNDLE_PATH):QMAKE_QML_BUNDLE_PATH = "qt_qml"
+ qmlTargetPath = $CODESIGNING_FOLDER_PATH/$$QMAKE_QML_BUNDLE_PATH
+ qtconfTargetPath = $CODESIGNING_FOLDER_PATH/qt.conf
+ }
- # place qt.conf in Contents/Resources in the app bundle
- QT_CONF_CONTENTS = \
- "[Paths]" \
- "Imports = Resources/qml" \
- "Qml2Imports = Resources/qml"
- QT_CONF = "$$OUT_PWD/$${TARGET}.app/Contents/Resources/qt.conf"
- write_file($$QT_CONF, QT_CONF_CONTENTS)|error("Aborting.")
- } else: ios {
- # flat bundle layout (no Contents/Resources)
- QmlImports.files *= $$QMLPATHS
- QMAKE_BUNDLE_DATA += QmlImports
-
- # write qt.conf to OUT_PWD and make xcode copy it via QMAKE_BUNDLE_DATA
+ # set import path in qt.conf to point to the bundeled qml:
QT_CONF_CONTENTS = \
"[Paths]" \
- "Imports = qml" \
- "Qml2Imports = qml"
- QT_CONF = "$$OUT_PWD/qt.conf"
- write_file($$QT_CONF, QT_CONF_CONTENTS)|error("Aborting.")
- QtConf.files = $$QT_CONF
- QMAKE_BUNDLE_DATA += QtConf
+ "Imports = $$QMAKE_QML_BUNDLE_PATH" \
+ "Qml2Imports = $$QMAKE_QML_BUNDLE_PATH"
+ write_file("$$OUT_PWD/qt.conf", QT_CONF_CONTENTS)|error("Aborting.")
+
+ # write qt.conf and copy each qml import dir into the bundle.
+ # But strip away archives and other files that are not needed:
+ !isEmpty(QMAKE_POST_LINK): QMAKE_POST_LINK += ";"
+ QMAKE_POST_LINK += \
+ "cp $$OUT_PWD/qt.conf $$qtconfTargetPath; " \
+ "test -d $$qmlTargetPath && rm -r $$qmlTargetPath; " \
+ "mkdir -p $$qmlTargetPath && " \
+ "for p in $$QMLPATHS; do" \
+ "rsync -r --exclude='*.a' --exclude='*.prl' --exclude='*.qmltypes' "
+ macx-xcode: QMAKE_POST_LINK += "$p/ $$qmlTargetPath; done"
+ else: QMAKE_POST_LINK += "\$\$p/ $$qmlTargetPath; done"
}
}
}
diff --git a/mkspecs/features/qt_android_deps.prf b/mkspecs/features/qt_android_deps.prf
index 96337da9de..7ec7bad047 100644
--- a/mkspecs/features/qt_android_deps.prf
+++ b/mkspecs/features/qt_android_deps.prf
@@ -64,6 +64,19 @@ DEPENDENCY_FILE = $$ANDROID_DEPENDS_DIR$$TARGET-android-dependencies.xml
}
}
+ !isEmpty(ANDROID_PERMISSIONS) {
+ for (ANDROID_PERMISSION, ANDROID_PERMISSIONS) {
+ FILE_CONTENT += "<permission name=\"$$ANDROID_PERMISSION\" />"
+ }
+ }
+
+ !isEmpty(ANDROID_FEATURES) {
+ for (ANDROID_FEATURE, ANDROID_FEATURES) {
+ FILE_CONTENT += "<feature name=\"$$ANDROID_FEATURE\" />"
+ }
+ }
+
+
!isEmpty(FILE_CONTENT) {
FILE_CONTENT = "<rules><dependencies><lib name=\"$$TARGET\"><depends>" $$FILE_CONTENT "</depends></lib></dependencies></rules>"
write_file($$DEPENDENCY_FILE, FILE_CONTENT) | error("Aborting.")
diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf
index a29e09cbc5..faa7a44f67 100644
--- a/mkspecs/features/qt_build_config.prf
+++ b/mkspecs/features/qt_build_config.prf
@@ -20,6 +20,14 @@
debug(1, "Not loading qmodule.pri twice")
}
+PRECOMPILED_DIR = .pch
+OBJECTS_DIR = .obj
+MOC_DIR = .moc
+RCC_DIR = .rcc
+UI_DIR = .uic
+
+QMAKE_DIR_REPLACE_SANE = PRECOMPILED_DIR OBJECTS_DIR MOC_DIR RCC_DIR UI_DIR
+
# force_independent can be set externally. prefix_build not.
!exists($$[QT_HOST_DATA]/.qmake.cache): \
CONFIG += prefix_build force_independent
diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
index 746e2878a7..22d66e8907 100644
--- a/mkspecs/features/qt_common.prf
+++ b/mkspecs/features/qt_common.prf
@@ -9,6 +9,9 @@
# We mean it.
#
+QMAKE_DIR_REPLACE_SANE += DESTDIR
+CONFIG -= debug_and_release_target
+
contains(QT_CONFIG, c++11): CONFIG += c++11
contains(TEMPLATE, .*lib) {
# module and plugins
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index f1f7c00b9e..1dacfedd02 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -1,11 +1,16 @@
defineReplace(qtPlatformTargetSuffix) {
+ ios:CONFIG(iphonesimulator, iphonesimulator|iphoneos): \
+ suffix = _iphonesimulator
+ else: \
+ suffix =
+
CONFIG(debug, debug|release) {
!debug_and_release|build_pass {
- mac:return(_debug)
- win32:return(d)
+ mac: return($${suffix}_debug)
+ win32: return($${suffix}d)
}
}
- return()
+ return($$suffix)
}
defineReplace(qtLibraryTarget) {
@@ -28,7 +33,7 @@ defineTest(qtAddLibrary) {
# Reverse-engineer the module name from the library name.
for(var, QT_MODULES) {
isEqual(QT.$${var}.name, $$1) {
- qtAddModule($$var, , LIBS)
+ qtAddModule($$var, LIBS)
return(true)
}
}
@@ -48,12 +53,12 @@ defineTest(qtProcessModuleFlags) {
# qt module
defineTest(qtHaveModule) {
- !isEmpty(QT.$${1}.name): \
+ !isEmpty(QT.$$replace(1, -, _).name): \
return(true)
return(false)
}
-# qt module, UsePrivate flag, libs variable
+# qt module, libs variable
defineTest(qtAddModule) {
MODULE_NAME = $$eval(QT.$${1}.name)
MODULE_INCLUDES = $$eval(QT.$${1}.includes)
@@ -61,8 +66,10 @@ defineTest(qtAddModule) {
MODULE_CONFIG = $$eval(QT.$${1}.module_config)
MODULE_MAJOR_VERSION = $$eval(QT.$${1}.MAJOR_VERSION)
- contains(MODULE_CONFIG, internal_module):!if(auto_use_privates|isEqual(2, UsePrivate)): \
- error("Module $$1 has no public API.")
+ contains(MODULE_CONFIG, internal_module) {
+ using_privates = true
+ export(using_privates)
+ }
qtProcessModuleFlags(CONFIG, QT.$${1}.CONFIG)
qtProcessModuleFlags(DEFINES, QT.$${1}.DEFINES)
@@ -77,80 +84,75 @@ defineTest(qtAddModule) {
!qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
INCLUDEPATH *= $$FRAMEWORK_INCLUDE
}
- auto_use_privates|isEqual(2, UsePrivate): \
+ contains(MODULE_CONFIG, internal_module): \
INCLUDEPATH += \
$$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION) \
$$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION)/$$MODULE_NAME
QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS}
- LINKAGE += -framework $${MODULE_NAME}$${QT_LIBINFIX}
+ export(QMAKE_FRAMEWORKPATH)
+ !contains(MODULE_CONFIG, no_link): \
+ LINKAGE += -framework $${MODULE_NAME}$${QT_LIBINFIX}
} else {
INCLUDEPATH *= $$MODULE_INCLUDES
- auto_use_privates|isEqual(2, UsePrivate): \
- INCLUDEPATH += $$eval(QT.$${1}.private_includes)
}
+ export(INCLUDEPATH)
- # Re-insert the major version in the library name (cf qtLibraryTarget above)
- # unless it's a framework build
- !mac|!contains(MODULE_CONFIG, lib_bundle): \
- MODULE_NAME ~= s,^Qt,Qt$$MODULE_MAJOR_VERSION,
-
- win32 {
- # Make sure the version number isn't appended again to the lib name
- ver_var = QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}_VERSION_OVERRIDE
- dver_var = QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}D_VERSION_OVERRIDE
- $$ver_var = 0
- $$dver_var = 0
- export($$ver_var)
- export($$dver_var)
- }
+ # Only link to this module if a libs directory is set, else this is just a module
+ # to give access to sources or include files, and not for linking.
+ !isEmpty(MODULE_LIBS):!contains(MODULE_CONFIG, no_link) {
+
+ # Re-insert the major version in the library name (cf qtLibraryTarget above)
+ # unless it's a framework build
+ !mac|!contains(MODULE_CONFIG, lib_bundle): \
+ MODULE_NAME ~= s,^Qt,Qt$$MODULE_MAJOR_VERSION,
+
+ win32 {
+ # Make sure the version number isn't appended again to the lib name
+ ver_var = QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}_VERSION_OVERRIDE
+ dver_var = QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}D_VERSION_OVERRIDE
+ $$ver_var = 0
+ $$dver_var = 0
+ export($$ver_var)
+ export($$dver_var)
+ }
- isEmpty(LINKAGE) {
- !isEmpty(MODULE_LIBS_ADD): LINKAGE = -L$$MODULE_LIBS_ADD
- lib = $${MODULE_NAME}$${QT_LIBINFIX}$$qtPlatformTargetSuffix()
- LINKAGE += -l$$lib
+ isEmpty(LINKAGE) {
+ !isEmpty(MODULE_LIBS_ADD): \
+ LINKAGE = -L$$MODULE_LIBS_ADD
+ lib = $${MODULE_NAME}$${QT_LIBINFIX}$$qtPlatformTargetSuffix()
+ LINKAGE += -l$$lib
- contains(QT_CONFIG, rpath): QMAKE_RPATHDIR *= $$eval(QT.$${1}.rpath)
+ contains(QT_CONFIG, rpath) {
+ QMAKE_RPATHDIR *= $$eval(QT.$${1}.rpath)
+ export(QMAKE_RPATHDIR)
+ }
+
+ contains(MODULE_CONFIG, staticlib) {
+ PRE_TARGETDEPS *= $$MODULE_LIBS/$${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_STATICLIB}
+ export(PRE_TARGETDEPS)
+ }
+ }
+
+ $$2 += $$LINKAGE
+ export($$2)
- contains(MODULE_CONFIG, staticlib): \
- PRE_TARGETDEPS *= $$MODULE_LIBS/$${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_STATICLIB}
- }
- # Only link to this module if a libs directory is set, else this is just a module
- # to give access to sources or include files, and not for linking.
- !isEmpty(MODULE_LIBS) {
!isEmpty(QMAKE_LSB) {
- !isEmpty(MODULE_LIBS_ADD): QMAKE_LFLAGS *= --lsb-libpath=$$MODULE_LIBS_ADD
- QMAKE_LIBDIR *= /opt/lsb/lib
+ !isEmpty(MODULE_LIBS_ADD): \
+ QMAKE_LFLAGS *= --lsb-libpath=$$MODULE_LIBS_ADD
QMAKE_LFLAGS *= --lsb-shared-libs=$${MODULE_NAME}$${QT_LIBINFIX}
+ QMAKE_LIBDIR *= /opt/lsb/lib
+ export(QMAKE_LFLAGS)
+ export(QMAKE_LIBDIR)
}
- $$3 += $$LINKAGE
}
- export($$3)
- export(INCLUDEPATH)
- export(QMAKE_FRAMEWORKPATH)
- export(QMAKE_LFLAGS)
- export(QMAKE_LIBDIR)
- export(QMAKE_RPATHDIR)
- export(QMAKE_RPATHLINKDIR)
- export(PRE_TARGETDEPS)
}
# qt variable, libs variable
defineTest(qtAddModules) {
- # Figure out from which modules we're wanting to use the private headers
- NEWQT =
- for(QTLIB, $$1) {
- QTLIBRAW = $$replace(QTLIB, -private$, )
- !isEqual(QTLIBRAW, $$QTLIB) {
- want_var = QT.$${QTLIBRAW}.want_private
- $$want_var = UsePrivate
- using_privates = true
- NEWQT += $$eval(QT.$${QTLIBRAW}.private_depends)
- }
- NEWQT += $$QTLIBRAW
- contains(QT.$${QTLIBRAW}.CONFIG, auto_use_privates): CONFIG += auto_use_privates
- }
+ # qmake variables cannot contain dashes, so normalize the names first
+ $$1 = $$replace($$1, -private$, _private)
# Topological resolution of modules based on their QT.<module>.depends variable
- $$1 = $$resolve_depends(NEWQT, "QT.")
+ $$1 = $$resolve_depends($$1, "QT.")
# Finally actually add the modules
unset(BAD_QT)
for(QTLIB, $$1) {
@@ -165,11 +167,9 @@ defineTest(qtAddModules) {
next()
}
- qtAddModule($$QTLIB, $$eval(QT.$${QTLIB}.want_private), $$2)
+ qtAddModule($$QTLIB, $$2)
}
- !isEmpty(BAD_QT):error("Unknown module(s) in $$1: $$BAD_QT")
-
- export(using_privates)
+ !isEmpty(BAD_QT):error("Unknown module(s) in $$1: $$replace(BAD_QT, _private$, -private)")
}
defineTest(qtAddRpathLink) {
@@ -178,7 +178,7 @@ defineTest(qtAddRpathLink) {
# This means that paths of direct dependencies (QT & QT_PRIVATE)
# don't need to appear here. However, their private dependencies'
# paths OTOH need to be put there.
- pubqt = $$replace(1, -private$, )
+ pubqt = $$replace(1, -private$, _private)
pubdep = $$resolve_depends(pubqt, "QT.")
privdep = $$resolve_depends(pubqt, "QT.", ".depends" ".private_depends" ".run_depends")
privdep -= $$pubdep
@@ -246,7 +246,7 @@ defineTest(qtAddToolEnv) {
# target variable, dependency var name, [non-empty: prepare for system(), not make]
defineTest(qtAddTargetEnv) {
- deps = $$replace($$2, -private$, )
+ deps = $$replace($$2, -private$, _private)
deps = $$resolve_depends(deps, "QT.", ".depends" ".private_depends" ".run_depends")
!isEmpty(deps) {
for(dep, deps) {
diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf
index e82b499009..7cacca9935 100644
--- a/mkspecs/features/qt_installs.prf
+++ b/mkspecs/features/qt_installs.prf
@@ -50,7 +50,12 @@ qt_install_module {
pritarget.path = $$[QT_HOST_DATA]/mkspecs/modules
pritarget.files = $$MODULE_PRI
INSTALLS += pritarget
- } else {
+ } else: isEmpty(MODULE_PRIVATE_PRI) {
warning("Project $$basename(_PRO_FILE_) is a module, but has not defined MODULE_PRI, which is required for Qt to expose the module to other projects.")
}
+ !isEmpty(MODULE_PRIVATE_PRI) {
+ privpritarget.path = $$[QT_HOST_DATA]/mkspecs/modules
+ privpritarget.files = $$MODULE_PRIVATE_PRI
+ INSTALLS += privpritarget
+ }
}
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index b614112fd7..5068f7028f 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -44,7 +44,10 @@ ucmodule = $$upper($$MODULE)
isEmpty(MODULE_INCNAME): MODULE_INCNAME = $$TARGET
-MODULE_DEPENDS = $$replace(QT, -private$, )
+internal_module: \
+ MODULE_DEPENDS = $$replace(QT, -private$, _private)
+else: \
+ MODULE_DEPENDS = $$replace(QT, -private$, )
MODULE_DEPENDS = $$unique(MODULE_DEPENDS)
contains(TARGET, QtAddOn.*): \
@@ -55,14 +58,14 @@ MODULE_DEFINES = $$MODULE_DEFINE $$MODULE_DEFINES
load(qt_module_pris)
-INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}.private_includes)
+INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}_private.includes)
!no_module_headers: load(qt_module_headers)
#other
TEMPLATE = lib
-DESTDIR = $$eval(QT.$${MODULE}.libs)
-win32:!wince*:!prefix_build: DLLDESTDIR = $$eval(QT.$${MODULE}.bins)
+DESTDIR = $$eval(QT.$${MODULE_ID}.libs)
+win32:!wince*:!prefix_build: DLLDESTDIR = $$eval(QT.$${MODULE_ID}.bins)
CONFIG += qmake_cache target_qt
@@ -92,7 +95,7 @@ mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) {
#QMAKE_FRAMEWORK_VERSION = 4.0
CONFIG += lib_bundle sliced_bundle qt_framework
CONFIG -= qt_install_headers #no need to install these as well
- !debug_and_release|if(build_all:CONFIG(release, debug|release)) {
+ !debug_and_release|!build_all|CONFIG(release, debug|release) {
FRAMEWORK_HEADERS.version = Versions
FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
FRAMEWORK_HEADERS.path = Headers
diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf
index 90e5288524..900ade9b6e 100644
--- a/mkspecs/features/qt_module_pris.prf
+++ b/mkspecs/features/qt_module_pris.prf
@@ -19,11 +19,25 @@ load(qt_build_paths)
CONFIG += split_incpath
force_independent|split_incpath: \
CONFIG += need_fwd_pri
-MODULE_FWD_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_lib_$${MODULE}.pri
+mod_work_pfx = $$MODULE_QMAKE_OUTDIR/mkspecs/modules
need_fwd_pri: \
- MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_lib_$${MODULE}.pri
+ mod_inst_pfx = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst
else: \
- MODULE_PRI = $$MODULE_FWD_PRI
+ mod_inst_pfx = $$mod_work_pfx
+!internal_module {
+ MODULE_ID = $$MODULE
+ MODULE_PRIVATE_PRI = $$mod_inst_pfx/qt_lib_$${MODULE}_private.pri
+ mods_to_load = $$MODULE $${MODULE}_private
+} else {
+ MODULE_ID = $${MODULE}_private
+ mods_to_load = $${MODULE}_private
+}
+need_fwd_pri: \
+ pris_to_load = $$MODULE_ID
+else: \
+ pris_to_load = $$mods_to_load
+MODULE_PRI = $$mod_inst_pfx/qt_lib_$${MODULE_ID}.pri
+MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
!build_pass {
@@ -34,20 +48,14 @@ else: \
module_libs = "\$\$QT_MODULE_LIB_BASE"
unix:!static {
host_build: \
- module_rpath = "QT.$${MODULE}.rpath = $$[QT_HOST_LIBS]"
+ module_rpath = "QT.$${MODULE_ID}.rpath = $$[QT_HOST_LIBS]"
else: \
- module_rpath = "QT.$${MODULE}.rpath = $$[QT_INSTALL_LIBS/raw]"
+ module_rpath = "QT.$${MODULE_ID}.rpath = $$[QT_INSTALL_LIBS/raw]"
} else {
module_rpath =
}
- !isEmpty(QT_FOR_PRIVATE) {
- contains(QT_FOR_PRIVATE, .*-private$):error("QT_FOR_PRIVATE may not contain *-private.")
- module_privdep = "QT.$${MODULE}.private_depends = $$QT_FOR_PRIVATE"
- } else {
- module_privdep =
- }
!isEmpty(QT_PRIVATE): \
- module_rundep = "QT.$${MODULE}.run_depends = $$unique($$list($$replace(QT_PRIVATE, -private$, )))"
+ module_rundep = "QT.$${MODULE_ID}.run_depends = $$replace(QT_PRIVATE, -private$, _private)"
else: \
module_rundep =
static: \
@@ -58,10 +66,8 @@ else: \
module_build_type =
internal_module: \
module_build_type += internal_module
- !isEmpty(module_build_type): \
- module_build_type = "QT.$${MODULE}.module_config = $$module_build_type"
!isEmpty(MODULE_CONFIG): \
- module_config = "QT.$${MODULE}.CONFIG = $$MODULE_CONFIG"
+ module_config = "QT.$${MODULE_ID}.CONFIG = $$MODULE_CONFIG"
else: \
module_config =
!no_module_headers:!minimal_syncqt {
@@ -74,46 +80,52 @@ else: \
$$MODULE_BASE_OUTDIR/include)
MODULE_INCLUDES += $$MODULE_AUX_INCLUDES
MODULE_PRIVATE_INCLUDES += $$MODULE_PRIVATE_AUX_INCLUDES
- internal_module {
- MODULE_PRIVATE_INCLUDES = $$MODULE_INCLUDES $$MODULE_PRIVATE_INCLUDES
- MODULE_INCLUDES =
- MODULE_PRIVATE_SHADOW_INCLUDES = $$MODULE_SHADOW_INCLUDES
- MODULE_SHADOW_INCLUDES =
- }
- split_incpath {
- !isEmpty(MODULE_SHADOW_INCLUDES): \
- MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE}.includes += $$MODULE_SHADOW_INCLUDES"
- !isEmpty(MODULE_PRIVATE_SHADOW_INCLUDES): \
- MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE}.private_includes += $$MODULE_PRIVATE_SHADOW_INCLUDES"
- }
+ internal_module: \
+ MODULE_INCLUDES += $$MODULE_PRIVATE_INCLUDES
+ split_incpath: \
+ MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE_ID}.includes += $$MODULE_SHADOW_INCLUDES"
MODULE_PRI_CONT = \
- "QT.$${MODULE}.VERSION = $${VERSION}" \
- "QT.$${MODULE}.MAJOR_VERSION = $$section(VERSION, ., 0, 0)" \
- "QT.$${MODULE}.MINOR_VERSION = $$section(VERSION, ., 1, 1)" \
- "QT.$${MODULE}.PATCH_VERSION = $$section(VERSION, ., 2, 2)" \
+ "QT.$${MODULE_ID}.VERSION = $${VERSION}" \
+ "QT.$${MODULE_ID}.MAJOR_VERSION = $$section(VERSION, ., 0, 0)" \
+ "QT.$${MODULE_ID}.MINOR_VERSION = $$section(VERSION, ., 1, 1)" \
+ "QT.$${MODULE_ID}.PATCH_VERSION = $$section(VERSION, ., 2, 2)" \
"" \
- "QT.$${MODULE}.name = $$TARGET" \
- "QT.$${MODULE}.libs = $$module_libs" \
+ "QT.$${MODULE_ID}.name = $$TARGET" \
+ "QT.$${MODULE_ID}.libs = $$module_libs" \
$$module_rpath \
- "QT.$${MODULE}.private_includes = $$MODULE_PRIVATE_INCLUDES"
+ "QT.$${MODULE_ID}.includes = $$MODULE_INCLUDES"
!host_build: MODULE_PRI_CONT += \
- "QT.$${MODULE}.includes = $$MODULE_INCLUDES" \
- "QT.$${MODULE}.bins = \$\$QT_MODULE_BIN_BASE" \
- "QT.$${MODULE}.libexecs = \$\$QT_MODULE_LIBEXEC_BASE" \
- "QT.$${MODULE}.plugins = \$\$QT_MODULE_PLUGIN_BASE" \
- "QT.$${MODULE}.imports = \$\$QT_MODULE_IMPORT_BASE" \
- "QT.$${MODULE}.qml = \$\$QT_MODULE_QML_BASE"
+ "QT.$${MODULE_ID}.bins = \$\$QT_MODULE_BIN_BASE" \
+ "QT.$${MODULE_ID}.libexecs = \$\$QT_MODULE_LIBEXEC_BASE" \
+ "QT.$${MODULE_ID}.plugins = \$\$QT_MODULE_PLUGIN_BASE" \
+ "QT.$${MODULE_ID}.imports = \$\$QT_MODULE_IMPORT_BASE" \
+ "QT.$${MODULE_ID}.qml = \$\$QT_MODULE_QML_BASE" \
+ $$join(MODULE_PLUGIN_TYPES, " ", "QT.$${MODULE_ID}.plugin_types = ")
MODULE_PRI_CONT += \
- "QT.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" \
- $$module_privdep \
+ "QT.$${MODULE_ID}.depends =$$join(MODULE_DEPENDS, " ", " ")" \
$$module_rundep \
- $$module_build_type \
+ "QT.$${MODULE_ID}.module_config =$$join(module_build_type, " ", " ")" \
$$module_config \
- "QT.$${MODULE}.DEFINES = $$MODULE_DEFINES" \ # assume sufficient quoting
+ "QT.$${MODULE_ID}.DEFINES = $$MODULE_DEFINES" \ # assume sufficient quoting
"" \
"QT_MODULES += $$MODULE"
write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.")
- MODULE_PRI_FILES = $$MODULE_PRI
+ !internal_module {
+ module_build_type += internal_module no_link
+ MODULE_PRIVATE_PRI_CONT = \
+ "QT.$${MODULE}_private.VERSION = $${VERSION}" \
+ "QT.$${MODULE}_private.MAJOR_VERSION = $$section(VERSION, ., 0, 0)" \
+ "QT.$${MODULE}_private.MINOR_VERSION = $$section(VERSION, ., 1, 1)" \
+ "QT.$${MODULE}_private.PATCH_VERSION = $$section(VERSION, ., 2, 2)" \
+ "" \
+ "QT.$${MODULE}_private.name = $${TARGET}" \ # Same name as base module
+ "QT.$${MODULE}_private.libs = $$module_libs" \
+ "QT.$${MODULE}_private.includes = $$MODULE_PRIVATE_INCLUDES" \
+ "QT.$${MODULE}_private.depends = $$replace($$list($$MODULE $$QT_FOR_PRIVATE), -private$, _private)" \
+ "QT.$${MODULE}_private.module_config =$$join(module_build_type, " ", " ")"
+ write_file($$MODULE_PRIVATE_PRI, MODULE_PRIVATE_PRI_CONT)|error("Aborting.")
+ }
+ MODULE_PRI_FILES = $$MODULE_PRI $$MODULE_PRIVATE_PRI
need_fwd_pri {
@@ -132,8 +144,10 @@ else: \
"QT_MODULE_HOST_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \
"QT_MODULE_LIBEXEC_BASE = $$MODULE_BASE_OUTDIR/libexec" \
"QT_MODULE_PLUGIN_BASE = $$MODULE_BASE_OUTDIR/plugins" \
- "include($$MODULE_PRI)" \
- $$MODULE_FWD_PRI_CONT_SUFFIX
+ "include($$MODULE_PRI)"
+ !internal_module: MODULE_FWD_PRI_CONT += \
+ "include($$MODULE_PRIVATE_PRI)"
+ MODULE_FWD_PRI_CONT += $$MODULE_FWD_PRI_CONT_SUFFIX
write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error("Aborting.")
touch($$MODULE_FWD_PRI, $$MODULE_PRI)
MODULE_PRI_FILES += $$MODULE_FWD_PRI
@@ -155,12 +169,15 @@ else: \
# Then, inject the new module into the current cache state
!contains(QMAKE_INTERNAL_INCLUDED_FILES, $$MODULE_PRI): \ # before the actual include()!
cache(QMAKE_INTERNAL_INCLUDED_FILES, add transient, MODULE_PRI_FILES)
- include($$MODULE_FWD_PRI)
- for(var, $$list(VERSION MAJOR_VERSION MINOR_VERSION PATCH_VERSION \
- name depends private_depends module_config CONFIG DEFINES sources \
- includes private_includes bins libs libexecs plugins imports qml \
- rpath_link rpath_link_private \
- )):defined(QT.$${MODULE}.$$var, var):cache(QT.$${MODULE}.$$var, transient)
+ for(pri, pris_to_load): \
+ include($$mod_work_pfx/qt_lib_$${pri}.pri)
+ for(mod, mods_to_load) {
+ for(var, $$list(VERSION MAJOR_VERSION MINOR_VERSION PATCH_VERSION \
+ name depends module_config CONFIG DEFINES sources \
+ includes bins libs libexecs plugins imports qml \
+ rpath_link \
+ )):defined(QT.$${mod}.$$var, var):cache(QT.$${mod}.$$var, transient)
+ }
cache(QT_MODULES, transient)
} # !build_pass
diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf
index f0f0fe567b..f0864f9e74 100644
--- a/mkspecs/features/qt_tool.prf
+++ b/mkspecs/features/qt_tool.prf
@@ -19,7 +19,7 @@ CONFIG += console
!build_pass:if(!host_build|!force_bootstrap|force_independent) {
isEmpty(MODULE):MODULE = $$TARGET
- !host_build|!force_bootstrap: MODULE_DEPENDS = $$replace(QT, -private$, )
+ !host_build|!force_bootstrap: MODULE_DEPENDS = $$replace(QT, -private$, _private)
load(qt_build_paths)
diff --git a/mkspecs/features/resolve_config.prf b/mkspecs/features/resolve_config.prf
index 3884598a94..7835fe4f7c 100644
--- a/mkspecs/features/resolve_config.prf
+++ b/mkspecs/features/resolve_config.prf
@@ -22,14 +22,8 @@ CONFIG(static, static|shared) {
contains(TEMPLATE, ".*lib"): CONFIG += dll
}
-static_and_shared {
- !macx-xcode: addExclusiveBuilds(static, Static, shared, Shared)
-} else: fix_output_dirs {
- static: \
- fixExclusiveOutputDirs(static, shared)
- else: \
- fixExclusiveOutputDirs(shared, static)
-}
+!macx-xcode: \
+ addExclusiveBuilds(shared, static)
CONFIG(debug, debug|release): \
CONFIG -= release
@@ -37,14 +31,7 @@ else: \
CONFIG -= debug
!macx-xcode {
- debug_and_release {
- addExclusiveBuilds(debug, Debug, release, Release)
- } else: fix_output_dirs {
- debug: \
- fixExclusiveOutputDirs(debug, release)
- else: \
- fixExclusiveOutputDirs(release, debug)
- }
+ addExclusiveBuilds(debug, release)
} else {
# The Xcode generator always generates project files with
# debug and release configurations, regardless of whether
diff --git a/mkspecs/features/resolve_target.prf b/mkspecs/features/resolve_target.prf
index 22d7722ce3..fe5808940a 100644
--- a/mkspecs/features/resolve_target.prf
+++ b/mkspecs/features/resolve_target.prf
@@ -11,6 +11,8 @@
load(resolve_config)
+exclusive_builds: load(exclusive_builds_post)
+
QMAKE_RESOLVED_TARGET = $$absolute_path($$DESTDIR, $$OUT_PWD)/
win32 {
diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf
index 7876ef1c34..ee5f1f0ea4 100644
--- a/mkspecs/linux-icc/qmake.conf
+++ b/mkspecs/linux-icc/qmake.conf
@@ -13,6 +13,7 @@ QMAKE_LEXFLAGS =
QMAKE_YACC = yacc
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS =
+QMAKE_CFLAGS_APP = -fPIE
QMAKE_CFLAGS_DEPS = -M
QMAKE_CFLAGS_WARN_ON = -w1 -Wall -Wcheck -wd1572,873,2259,2261
QMAKE_CFLAGS_WARN_OFF = -w
@@ -33,6 +34,7 @@ QMAKE_CFLAGS_AVX2 += -xCORE-AVX2
QMAKE_CXX = icpc
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
+QMAKE_CXXFLAGS_APP = $$QMAKE_CFLAGS_APP
QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
@@ -63,6 +65,7 @@ QMAKE_LFLAGS_SONAME = -Wl,-soname,
QMAKE_LFLAGS_THREAD =
QMAKE_LFLAGS_NOUNDEF = -Wl,-z,defs
QMAKE_LFLAGS_RPATH = -Wl,-rpath,
+QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link,
QMAKE_LFLAGS_CXX11 =
QMAKE_LIBS =
diff --git a/mkspecs/macx-clang-32/Info.plist.app b/mkspecs/macx-clang-32/Info.plist.app
index 187a8e0aa4..8e44bd7f60 100644
--- a/mkspecs/macx-clang-32/Info.plist.app
+++ b/mkspecs/macx-clang-32/Info.plist.app
@@ -15,7 +15,7 @@
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.@EXECUTABLE@</string>
+ <string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
</dict>
diff --git a/mkspecs/macx-clang/Info.plist.app b/mkspecs/macx-clang/Info.plist.app
index 187a8e0aa4..8e44bd7f60 100644
--- a/mkspecs/macx-clang/Info.plist.app
+++ b/mkspecs/macx-clang/Info.plist.app
@@ -15,7 +15,7 @@
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.@EXECUTABLE@</string>
+ <string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
</dict>
diff --git a/mkspecs/macx-g++-32/Info.plist.app b/mkspecs/macx-g++-32/Info.plist.app
index 187a8e0aa4..8e44bd7f60 100644
--- a/mkspecs/macx-g++-32/Info.plist.app
+++ b/mkspecs/macx-g++-32/Info.plist.app
@@ -15,7 +15,7 @@
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.@EXECUTABLE@</string>
+ <string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
</dict>
diff --git a/mkspecs/macx-g++/Info.plist.app b/mkspecs/macx-g++/Info.plist.app
index 187a8e0aa4..8e44bd7f60 100644
--- a/mkspecs/macx-g++/Info.plist.app
+++ b/mkspecs/macx-g++/Info.plist.app
@@ -15,7 +15,7 @@
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.@EXECUTABLE@</string>
+ <string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
</dict>
diff --git a/mkspecs/macx-g++40/Info.plist.app b/mkspecs/macx-g++40/Info.plist.app
index 187a8e0aa4..8e44bd7f60 100644
--- a/mkspecs/macx-g++40/Info.plist.app
+++ b/mkspecs/macx-g++40/Info.plist.app
@@ -15,7 +15,7 @@
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.@EXECUTABLE@</string>
+ <string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
</dict>
diff --git a/mkspecs/macx-g++42/Info.plist.app b/mkspecs/macx-g++42/Info.plist.app
index 187a8e0aa4..8e44bd7f60 100644
--- a/mkspecs/macx-g++42/Info.plist.app
+++ b/mkspecs/macx-g++42/Info.plist.app
@@ -15,7 +15,7 @@
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.@EXECUTABLE@</string>
+ <string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
</dict>
diff --git a/mkspecs/macx-icc/Info.plist.app b/mkspecs/macx-icc/Info.plist.app
index 187a8e0aa4..8e44bd7f60 100644
--- a/mkspecs/macx-icc/Info.plist.app
+++ b/mkspecs/macx-icc/Info.plist.app
@@ -15,7 +15,7 @@
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.@EXECUTABLE@</string>
+ <string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
</dict>
diff --git a/mkspecs/macx-ios-clang/Info.plist.app b/mkspecs/macx-ios-clang/Info.plist.app
index 91f4b3d07e..5a0a631d7f 100755
--- a/mkspecs/macx-ios-clang/Info.plist.app
+++ b/mkspecs/macx-ios-clang/Info.plist.app
@@ -13,7 +13,7 @@
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.@BUNDLEIDENTIFIER@</string>
+ <string>@BUNDLEIDENTIFIER@</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleName</key>
diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf
index 0d38c058c9..0a35b1167d 100644
--- a/mkspecs/macx-ios-clang/features/default_post.prf
+++ b/mkspecs/macx-ios-clang/features/default_post.prf
@@ -1,6 +1,21 @@
-equals(TEMPLATE, app) {
+# In case the user sets the SDK manually
+contains(QMAKE_MAC_SDK, ^iphonesimulator.*) {
+ iphonesimulator_and_iphoneos: \
+ error("iOS simulator is handled automatically for iphonesimulator_and_iphoneos")
+
+ CONFIG += iphonesimulator
+}
+
+# Resolve config so we don't need to use CONFIG() later on
+CONFIG(iphonesimulator, iphonesimulator|iphoneos) {
+ CONFIG -= iphoneos
+} else {
+ CONFIG -= iphonesimulator
+ CONFIG += iphoneos
+}
+equals(TEMPLATE, app) {
# If the application uses Qt, it needs to be an application bundle
# to be able to deploy and run on iOS. The only exception to this
# is if you're working with a jailbroken device and can run the
@@ -8,47 +23,150 @@ equals(TEMPLATE, app) {
# use-case we care about, so no need to complicate the logic.
qt: CONFIG *= app_bundle
- # Application bundles require building through Xcode
- app_bundle:!macx-xcode {
- # For Qt applications we want Xcode project files as the generated output,
- # but since qmake doesn't handle the transition between makefiles and Xcode
- # project files (which happens when using subdirs), we create a wrapper
- # makefile that takes care of generating the Xcode project, and allows
- # building by calling out to xcodebuild.
- TEMPLATE = aux
-
- CONFIG =
- SOURCES =
- OBJECTIVE_SOURCES =
- RESOURCES =
- INSTALLS =
- QMAKE_EXTRA_COMPILERS =
- QMAKE_EXTRA_TARGETS =
-
- TARGET_XCODE_PROJECT_DIR = $${TARGET}.xcodeproj
-
- system("cd $$system_quote($$OUT_PWD) && $${QMAKE_QMAKE} $$system_quote($$_PRO_FILE_) -spec macx-xcode")
-
- # We use xcodebuild to do the actual build, but filter out the verbose
- # output that shows all environment variables for each build step.
- xcodebuild_build.commands = "@bash -o pipefail -c 'xcodebuild | grep -v setenv'"
- QMAKE_EXTRA_TARGETS += xcodebuild_build
- all.depends = xcodebuild_build
- QMAKE_EXTRA_TARGETS += all
-
- # We do the same for the clean action
- xcodebuild_clean.commands = "@xcodebuild clean"
- QMAKE_EXTRA_TARGETS += xcodebuild_clean
- clean.depends = xcodebuild_clean
- QMAKE_EXTRA_TARGETS += clean
-
- # And distclean
- xcodebuild_distclean.commands = "$(DEL_FILE) -R $$TARGET_XCODE_PROJECT_DIR"
- xcodebuild_distclean.depends = xcodebuild_clean
- QMAKE_EXTRA_TARGETS += xcodebuild_distclean
- distclean.depends = xcodebuild_distclean
- QMAKE_EXTRA_TARGETS += distclean
+ app_bundle {
+ macx-xcode {
+ # There is no way to genereate Xcode projects that are limited to either
+ # simulator or device builds, so iphonesimulator_and_iphoneos is always
+ # effectivly active, even if the user disabled it explicitly.
+ # The Xcode generator doesn't support multiple BUILDS though (exclusive
+ # builds), so we have to manually set up the simulator suffix.
+ library_suffix_iphonesimulator.name = "$${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING}[sdk=iphonesimulator*]"
+ library_suffix_iphonesimulator.value = "_iphonesimulator$($${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING})"
+ QMAKE_MAC_XCODE_SETTINGS += library_suffix_iphonesimulator
+ CONFIG *= xcode_dynamic_library_suffix
+ } else {
+ # For Qt applications we want Xcode project files as the generated output,
+ # but since qmake doesn't handle the transition between makefiles and Xcode
+ # project files (which happens when using subdirs), we create a wrapper
+ # makefile that takes care of generating the Xcode project, and allows
+ # building by calling out to xcodebuild.
+ TEMPLATE = aux
+
+ SOURCES =
+ OBJECTIVE_SOURCES =
+ RESOURCES =
+ INSTALLS =
+ QMAKE_EXTRA_COMPILERS =
+ QMAKE_EXTRA_TARGETS =
+
+ !build_pass {
+ CONFIG += debug_and_release
+ load(resolve_config)
+
+ CONFIG += iphonesimulator_and_iphoneos
+ iphonesimulator.name = Simulator
+ iphoneos.name = Device
+ addExclusiveBuilds(iphonesimulator, iphoneos)
+
+ load(exclusive_builds_post)
+
+ xcode_distclean.commands = "$(DEL_FILE) -R $${TARGET}.xcodeproj"
+ xcode_distclean.depends = \
+ debug-iphonesimulator-distclean debug-iphoneos-distclean \
+ release-iphonesimulator-distclean release-iphoneos-distclean
+ QMAKE_EXTRA_TARGETS += xcode_distclean
+ distclean.depends = xcode_distclean
+ QMAKE_EXTRA_TARGETS += distclean
+
+ args =
+ for(arg, QMAKE_ARGS): \
+ args += $$system_quote($$arg)
+ system("cd $$system_quote($$OUT_PWD) && $$QMAKE_QMAKE $$args $$system_quote($$_PRO_FILE_) -spec macx-xcode")
+
+ } else {
+ load(resolve_config)
+
+ iphonesimulator: \
+ sdk = iphonesimulator
+ else: \
+ sdk = iphoneos
+
+ debug: \
+ cfg = debug
+ else: \
+ cfg = release
+
+ for(action, $$list(build install clean)) {
+ equals(action, build) {
+ action_target_suffix =
+ action_target = all
+ } else {
+ action_target_suffix = -$$action
+ action_target = $$action
+ }
+
+ target = $${sdk}-$${cfg}$${action_target_suffix}
+
+ $${target}.commands = "@bash -o pipefail -c 'xcodebuild $$action -sdk $$sdk -configuration $$title($$cfg) | grep -v setenv'"
+ QMAKE_EXTRA_TARGETS += $$target
+
+ $${action_target}.depends += $$target
+ QMAKE_EXTRA_TARGETS *= $${action_target}
+ }
+
+ xcode_build_dir_distclean.commands = "$(DEL_FILE) -R $$title($$cfg)-$${sdk}"
+ xcode_build_dir_distclean.depends = clean
+ QMAKE_EXTRA_TARGETS += xcode_build_dir_distclean
+ distclean.depends = xcode_build_dir_distclean
+ QMAKE_EXTRA_TARGETS += distclean
+ }
+
+ CONFIG =
+ }
+ }
+} else: equals(TEMPLATE, lib) {
+ iphonesimulator.name = Simulator
+ iphoneos.name = Device
+ addExclusiveBuilds(iphonesimulator, iphoneos)
+
+ iphonesimulator_and_iphoneos:iphonesimulator {
+ QT_ARCH = i386
+ QMAKE_MAC_SDK ~= s,^iphoneos,iphonesimulator,
+
+ # Since the CPU feature detection done by configure is limited to one
+ # target at the moment, we disable SIMD support for simulator.
+ CONFIG -= simd
}
+} else: equals(TEMPLATE, subdirs) {
+ # Prevent recursion into host_builds
+ for(subdir, SUBDIRS) {
+ contains($${subdir}.CONFIG, host_build) {
+ $${subdir}.CONFIG += no_iphoneos_target no_iphonesimulator_target
+
+ # Other targets which we do want to recurse into may depend on this target,
+ # for example corelib depends on moc, rcc, bootstrap, etc, and other libs
+ # may depend on host-tools that are needed to build the lib, so we resolve
+ # the final target name and redirect it to the base target, so that the
+ # dependency chain is not broken for the other targets.
+
+ !isEmpty($${subdir}.target) {
+ target = $$eval($${subdir}.target)
+ } else {
+ !isEmpty($${subdir}.file): \
+ file = $$eval($${subdir}.file)
+ else: !isEmpty($${subdir}.subdir): \
+ file = $$eval($${subdir}.subdir)
+ else: \
+ file = $$subdir
+
+ target = sub-$$file
+ }
+
+ target ~= s,[^a-zA-Z0-9_],-,
+
+ $${target}-iphonesimulator.depends = $$target
+ $${target}-iphoneos.depends = $$target
+ QMAKE_EXTRA_TARGETS += $${target}-iphonesimulator $${target}-iphoneos
+ }
+ }
+
+ prepareRecursiveTarget(iphonesimulator)
+ prepareRecursiveTarget(iphoneos)
+ QMAKE_EXTRA_TARGETS += iphonesimulator iphoneos
+
+} else: equals(TEMPLATE, aux) {
+ # Dummy targets for the 'aux' TEMPLATE, so we can always recurse
+ QMAKE_EXTRA_TARGETS *= iphonesimulator iphoneos
}
macx-xcode {
@@ -57,15 +175,21 @@ macx-xcode {
QMAKE_MAC_XCODE_SETTINGS += ios_device_family
}
-# Be more specific about which architecture we're targeting
-equals(QT_ARCH, arm): \
- actual_archs = $$QMAKE_IOS_DEVICE_ARCHS
-else: \
- actual_archs = $$QMAKE_IOS_SIMULATOR_ARCHS
-
macx-xcode {
- QMAKE_XCODE_ARCHS = $$actual_archs
+ arch_iphoneos.name = "ARCHS[sdk=iphoneos*]"
+ arch_iphoneos.value = $$QMAKE_IOS_DEVICE_ARCHS
+ arch_iphonesimulator.name = "ARCHS[sdk=iphonesimulator*]"
+ arch_iphonesimulator.value = $$QMAKE_IOS_SIMULATOR_ARCHS
+
+ QMAKE_MAC_XCODE_SETTINGS += arch_iphoneos arch_iphonesimulator
+ unset(QMAKE_XCODE_ARCHS)
} else {
+# Be more specific about which architecture we're targeting
+ equals(QT_ARCH, arm): \
+ actual_archs = $$QMAKE_IOS_DEVICE_ARCHS
+ else: \
+ actual_archs = $$QMAKE_IOS_SIMULATOR_ARCHS
+
for(arch, actual_archs): \
arch_flags += -arch $$arch
diff --git a/mkspecs/macx-ios-clang/features/default_pre.prf b/mkspecs/macx-ios-clang/features/default_pre.prf
index b37f67495c..3501f5eae0 100644
--- a/mkspecs/macx-ios-clang/features/default_pre.prf
+++ b/mkspecs/macx-ios-clang/features/default_pre.prf
@@ -1,6 +1,10 @@
load(default_pre)
+# In case Qt was built for a specific SDK
+!iphonesimulator_and_iphoneos:contains(QMAKE_MAC_SDK, ^iphonesimulator.*): \
+ CONFIG += iphonesimulator
+
# Check for supported Xcode versions
lessThan(QMAKE_XCODE_VERSION, "4.3"): \
error("This mkspec requires Xcode 4.3 or later")
diff --git a/mkspecs/macx-ios-clang/features/qt.prf b/mkspecs/macx-ios-clang/features/qt.prf
index 2897c62819..9202a70a5a 100644
--- a/mkspecs/macx-ios-clang/features/qt.prf
+++ b/mkspecs/macx-ios-clang/features/qt.prf
@@ -31,14 +31,19 @@ equals(TEMPLATE, app):contains(QT, gui(-private)?) {
# able to add symbolic breakpoints for 'main', not caring that the symbol is actually
# called 'qt_main' now.
- isEmpty(OBJECTS_DIR): \
- OBJECTS_DIR = .
+ macx-xcode {
+ objects_dir = "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}/${CURRENT_ARCH}"
+ } else {
+ objects_dir = $$OBJECTS_DIR
+ isEmpty(objects_dir): \
+ objects_dir = .
+ }
!isEmpty(QMAKE_PRE_LINK): \
QMAKE_PRE_LINK += ";"
QMAKE_PRE_LINK += \
- "for f in $(find $${OBJECTS_DIR} -name '*.o'); do" \
+ "for f in $(find $${objects_dir} -name '*.o'); do" \
"(nm $f | grep -q 'T _main' && cp $f $f.original" \
"&& ld -r -alias _main _qt_main -unexported_symbol _main $f.original -o $f)" \
"|| true" \
diff --git a/mkspecs/macx-llvm/Info.plist.app b/mkspecs/macx-llvm/Info.plist.app
index 187a8e0aa4..8e44bd7f60 100644
--- a/mkspecs/macx-llvm/Info.plist.app
+++ b/mkspecs/macx-llvm/Info.plist.app
@@ -15,7 +15,7 @@
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.@EXECUTABLE@</string>
+ <string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
</dict>
diff --git a/mkspecs/win32-msvc2005/qplatformdefs.h b/mkspecs/win32-msvc2005/qplatformdefs.h
index c6feb4895d..c7370f1c63 100644
--- a/mkspecs/win32-msvc2005/qplatformdefs.h
+++ b/mkspecs/win32-msvc2005/qplatformdefs.h
@@ -81,6 +81,8 @@
#define QT_STAT_MASK _S_IFMT
#if defined(_S_IFLNK)
# define QT_STAT_LNK _S_IFLNK
+#else
+# define QT_STAT_LNK 0120000
#endif
#define QT_FILENO _fileno
#define QT_OPEN ::_open
diff --git a/mkspecs/win32-msvc2013/qmake.conf b/mkspecs/win32-msvc2013/qmake.conf
index 89d2dd45a4..7ca261f1d4 100644
--- a/mkspecs/win32-msvc2013/qmake.conf
+++ b/mkspecs/win32-msvc2013/qmake.conf
@@ -21,7 +21,7 @@ QMAKE_LEX = flex
QMAKE_LEXFLAGS =
QMAKE_YACC = byacc
QMAKE_YACCFLAGS = -d
-QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t
+QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t -FS
QMAKE_CFLAGS_WARN_ON = -W3
QMAKE_CFLAGS_WARN_OFF = -W0
QMAKE_CFLAGS_RELEASE = -O2 -MD