summaryrefslogtreecommitdiffstats
path: root/qmake/generators/mac/pbuilder_pbx.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-12-05 16:08:11 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-12-12 14:56:31 +0100
commitf733c1c6e70e14fa64923f6601273d3a7d7f2325 (patch)
treecc0c0d9582564da806a16b606684ac980f6f3b07 /qmake/generators/mac/pbuilder_pbx.cpp
parent1dca7087e9a8ae6bdeb46be4f57948549c1f7362 (diff)
Xcode: Use output directory as SYMROOT when shadow-building
Setting the CONFIGURATION_BUILD_DIR variable to tell Xcode where to place the final application bundle confuses Xcode when archiving a project, and the archive ends up without the dSYM files. Unfortunately we can't leave it up to Xcode to place the build artifacts wherever it wants, as Qt Creator's iOS support expects to find the artifacts in a well-defined place. Until we've taught Qt Creator to find the artifacts for deployment where Xcode placed them we need to keep this logic. We now avoid setting the CONFIGURATION_BUILD_DIR variable unless we really need to due to in-source builds. As long as we're dealing with a shadow-build it's okey to set SYMROOT. Change-Id: I9661c1c57725dc8ba5a21f8467b8b61834f2e64d Fixes: QTBUG-74841 Task-number: QTBUG-52474 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'qmake/generators/mac/pbuilder_pbx.cpp')
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 24e69444c9..c2f6df7787 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -1629,17 +1629,24 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
}
- // The symroot is marked by xcodebuild as excluded from Time Machine
- // backups, as it's a temporary build dir, so we don't want it to be
- // the same as the possibe in-source dir, as that would leave out
- // sources from being backed up.
- t << "\t\t\t\t" << writeSettings("SYMROOT",
- Option::output_dir + Option::dir_sep + ".xcode") << ";\n";
-
- // The configuration build dir however is not treated as excluded,
- // so we can safely point it to the root output dir.
- t << "\t\t\t\t" << writeSettings("CONFIGURATION_BUILD_DIR",
- Option::output_dir + Option::dir_sep + "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)") << ";\n";
+ if (Option::output_dir != qmake_getpwd()) {
+ // The SYMROOT is marked by Xcode as excluded from Time Machine
+ // backups, as it's a temporary build dir, but that's fine when
+ // we are shadow building.
+ t << "\t\t\t\t" << writeSettings("SYMROOT", "$(PROJECT_DIR)") << ";\n";
+ } else {
+ // For in-source builds we don't want to exclude the sources
+ // from being backed up, so we point SYMROOT to a temporary
+ // build directory.
+ t << "\t\t\t\t" << writeSettings("SYMROOT", ".xcode") << ";\n";
+
+ // Then we set the configuration build dir instead, so that the
+ // final build artifacts end up in the place Qt Creator expects.
+ // The disadvantage of using this over SYMROOT is that Xcode will
+ // fail to archive projects that override this variable.
+ t << "\t\t\t\t" << writeSettings("CONFIGURATION_BUILD_DIR",
+ "$(PROJECT_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)") << ";\n";
+ }
if (!project->isEmpty("DESTDIR")) {
ProString dir = project->first("DESTDIR");