summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-10-16 17:40:01 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-17 13:25:58 +0200
commitb5fe1ed1724a34765a91faa135b2dd98e1941f58 (patch)
tree96e19274dcdc4edba0f9a1456adb278afb9b3161 /qmake
parente6cac2c19315c9127f5b4048088e66da6b9296fe (diff)
qmake: Add support for QMAKE_{PRE,POST}_LINK in the Xcode generator
Change-Id: I038cf0aebb74d7ecfe6cb3ed868287042342eb7e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 03887e7938..524603aa63 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -1019,6 +1019,27 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("shellScript", "make -C " + IoUtils::shellQuoteUnix(qmake_getpwd()) + " -f " + IoUtils::shellQuoteUnix(mkfile)) << ";\n"
<< "\t\t};\n";
}
+
+ if (!project->isEmpty("QMAKE_PRE_LINK")) {
+ QString phase_key = keyFor("QMAKE_PBX_PRELINK_BUILDPHASE");
+ project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
+ t << "\t\t" << phase_key << " = {\n"
+ << "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n"
+ << "\t\t\t" << writeSettings("files", ProStringList(), SettingsAsList, 4) << ";\n"
+ // The build phases are not executed in the order they are defined, but by their
+ // 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 all the
+ // object files, and "write" to the list of files to link achieves that.
+ << "\t\t\t" << writeSettings("inputPaths", ProStringList("$(OBJECT_FILE_DIR_$(CURRENT_VARIANT))/$(CURRENT_ARCH)/*" + Option::obj_ext), SettingsAsList, 4) << ";\n"
+ << "\t\t\t" << writeSettings("outputPaths", ProStringList("$(LINK_FILE_LIST_$(CURRENT_VARIANT)_$(CURRENT_ARCH))"), 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"
+ << "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";\n"
+ << "\t\t\t" << writeSettings("shellScript", project->values("QMAKE_PRE_LINK")) << ";\n"
+ << "\t\t};\n";
+ }
+
//LIBRARY BUILDPHASE
if(!project->isEmpty("QMAKE_PBX_LIBRARIES")) {
tmp = project->values("QMAKE_PBX_LIBRARIES");
@@ -1044,6 +1065,24 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("name", escapeFilePath(grp)) << ";\n"
<< "\t\t};\n";
}
+
+ if (!project->isEmpty("QMAKE_POST_LINK")) {
+ QString phase_key = keyFor("QMAKE_PBX_POSTLINK_BUILDPHASE");
+ project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
+ t << "\t\t" << phase_key << " = {\n"
+ << "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n"
+ << "\t\t\t" << writeSettings("files", ProStringList(), SettingsAsList, 4) << ";\n"
+ // The build phases are not executed in the order they are defined, but by their
+ // resolved dependenices, so we have to ensure the phase is run after linking.
+ << "\t\t\t" << writeSettings("inputPaths", ProStringList("$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)"), 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 Postlink") << ";\n"
+ << "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";\n"
+ << "\t\t\t" << writeSettings("shellScript", project->values("QMAKE_POST_LINK")) << ";\n"
+ << "\t\t};\n";
+ }
+
if (!project->isEmpty("DESTDIR")) {
QString phase_key = keyFor("QMAKE_PBX_TARGET_COPY_PHASE");
QString destDir = project->first("DESTDIR").toQString();