summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2014-11-06 16:11:01 +0100
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>2014-11-12 14:01:33 +0100
commit91e53a7b9cb30e330c86c8bc460159fe14945042 (patch)
tree9592fc73779146dea81bdd6ca0b4ed2bd6a48a99
parentd4fcf2ca40e635cc0f198afe6e17e88ba098835b (diff)
Xcode: Make sure QMAKE_PRE_LINK dependencies are complete for multi-arch builds
With multi-architecture builds and ONLY_ACTIVE_ARCH set to NO, Xcode will build the final target for multiple architectures at the same time, but CURRENT_ARCH will only match one of them, so we failed to set up the right dependencies for our pre-link step, causing the step to happen after linking in some cases. We now build an exhaustive dependency list based on QMAKE_XCODE_ARCHS, so that ONLY_ACTIVE_ARCH=NO can be used for release builds targeted at the App Store. Change-Id: I6702f020a6970807adc624779f6dde09be62beb9 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 4624496e99..0ff42500de 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -1029,6 +1029,21 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if (!project->isEmpty("QMAKE_PRE_LINK")) {
QString phase_key = keyFor("QMAKE_PBX_PRELINK_BUILDPHASE");
project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
+
+ ProStringList inputPaths;
+ ProStringList outputPaths;
+ const ProStringList &archs = project->values("QMAKE_XCODE_ARCHS");
+ if (!archs.isEmpty()) {
+ for (int i = 0; i < archs.size(); ++i) {
+ const ProString &arch = archs.at(i);
+ inputPaths << "$(OBJECT_FILE_DIR_$(CURRENT_VARIANT))/" + arch + "/";
+ outputPaths << "$(LINK_FILE_LIST_$(CURRENT_VARIANT)_" + arch + ")";
+ }
+ } else {
+ inputPaths << "$(OBJECT_FILE_DIR_$(CURRENT_VARIANT))/$(CURRENT_ARCH)/";
+ outputPaths << "$(LINK_FILE_LIST_$(CURRENT_VARIANT)_$(CURRENT_ARCH))";
+ }
+
t << "\t\t" << phase_key << " = {\n"
<< "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("files", ProStringList(), SettingsAsList, 4) << ";\n"
@@ -1036,8 +1051,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
// resolved dependenices, so we have to ensure that this phase is run after the
// compilation phase, and before the link phase. Making the phase depend on the
// object file directory, and "write" to the list of files to link achieves that.
- << "\t\t\t" << writeSettings("inputPaths", ProStringList("$(OBJECT_FILE_DIR_$(CURRENT_VARIANT))/$(CURRENT_ARCH)/"), SettingsAsList, 4) << ";\n"
- << "\t\t\t" << writeSettings("outputPaths", ProStringList("$(LINK_FILE_LIST_$(CURRENT_VARIANT)_$(CURRENT_ARCH))"), SettingsAsList, 4) << ";\n"
+ << "\t\t\t" << writeSettings("inputPaths", inputPaths, SettingsAsList, 4) << ";\n"
+ << "\t\t\t" << writeSettings("outputPaths", outputPaths, SettingsAsList, 4) << ";\n"
<< "\t\t\t" << writeSettings("isa", "PBXShellScriptBuildPhase", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("name", "Qt Prelink") << ";\n"