summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-05 18:14:13 (GMT)
committerBrad King <brad.king@kitware.com>2017-04-11 15:40:15 (GMT)
commit8c346bbc6ec3321c8ac99a5495cf4d842c71e260 (patch)
tree7dbba9d89a904cd604338daecb9d663e9fd879ae /Source/cmGlobalXCodeGenerator.cxx
parent5f4e26dfc8c4ae26e9226236a05d20b826100db9 (diff)
downloadCMake-8c346bbc6ec3321c8ac99a5495cf4d842c71e260.zip
CMake-8c346bbc6ec3321c8ac99a5495cf4d842c71e260.tar.gz
CMake-8c346bbc6ec3321c8ac99a5495cf4d842c71e260.tar.bz2
Xcode: Compute a concrete object file arch dir if possible
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index efcbeff..d07cc3d 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -152,6 +152,7 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(cmake* cm,
this->CurrentLocalGenerator = 0;
this->XcodeBuildCommandInitialized = false;
+ this->ObjectDirArchDefault = "$(CURRENT_ARCH)";
this->ComputeObjectDirArch();
cm->GetState()->SetIsGeneratorMultiConfig(true);
@@ -3210,12 +3211,28 @@ void cmGlobalXCodeGenerator::ComputeArchitectures(cmMakefile* mf)
cmSystemTools::ExpandListArgument(std::string(osxArch),
this->Architectures);
}
+
+ if (this->Architectures.empty()) {
+ // With no ARCHS we use ONLY_ACTIVE_ARCH.
+ // Look up the arch that Xcode chooses in this case.
+ if (const char* arch = mf->GetDefinition("CMAKE_XCODE_CURRENT_ARCH")) {
+ this->ObjectDirArchDefault = arch;
+ }
+ }
+
+ this->ComputeObjectDirArch();
}
void cmGlobalXCodeGenerator::ComputeObjectDirArch()
{
if (this->XcodeVersion >= 21) {
- this->ObjectDirArch = "$(CURRENT_ARCH)";
+ if (this->Architectures.size() > 1) {
+ this->ObjectDirArch = "$(CURRENT_ARCH)";
+ } else if (!this->Architectures.empty()) {
+ this->ObjectDirArch = this->Architectures[0];
+ } else {
+ this->ObjectDirArch = this->ObjectDirArchDefault;
+ }
} else {
#if defined(__ppc__)
this->ObjectDirArch = "ppc";