Xcode: Compute a concrete object file arch dir if possible

This commit is contained in:
Brad King committed 2017-04-11 11:40:15 -04:00
1 parent 5f4e26dfc8
commit 8c346bbc6e
2 files changed
+19 -1

No files matched your search

+18 -1
View File
@@ -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";
+1
View File
@@ -264,6 +264,7 @@ private:
std::map<std::string, cmXCodeObject*> FileRefs;
std::map<cmGeneratorTarget const*, cmXCodeObject*> XCodeObjectMap;
std::vector<std::string> Architectures;
std::string ObjectDirArchDefault;
std::string ObjectDirArch;
std::string GeneratorToolset;
};