summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-05 18:00:27 (GMT)
committerBrad King <brad.king@kitware.com>2017-04-11 15:40:15 (GMT)
commit5f4e26dfc8c4ae26e9226236a05d20b826100db9 (patch)
tree78f80c0969df41167b08adbc8c81a87f673c8dc0 /Source
parent5b29fd6d4df4eea8ac04a3f6287f721e28b6b5b4 (diff)
downloadCMake-5f4e26dfc8c4ae26e9226236a05d20b826100db9.zip
CMake-5f4e26dfc8c4ae26e9226236a05d20b826100db9.tar.gz
CMake-5f4e26dfc8c4ae26e9226236a05d20b826100db9.tar.bz2
Xcode: Refactor object directory name computation
Factor out a helper function to compute the object directory name architecture component.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx29
-rw-r--r--Source/cmGlobalXCodeGenerator.h2
2 files changed, 21 insertions, 10 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index cbad52c..efcbeff 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -152,6 +152,8 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(cmake* cm,
this->CurrentLocalGenerator = 0;
this->XcodeBuildCommandInitialized = false;
+ this->ComputeObjectDirArch();
+
cm->GetState()->SetIsGeneratorMultiConfig(true);
}
@@ -3210,6 +3212,21 @@ void cmGlobalXCodeGenerator::ComputeArchitectures(cmMakefile* mf)
}
}
+void cmGlobalXCodeGenerator::ComputeObjectDirArch()
+{
+ if (this->XcodeVersion >= 21) {
+ this->ObjectDirArch = "$(CURRENT_ARCH)";
+ } else {
+#if defined(__ppc__)
+ this->ObjectDirArch = "ppc";
+#elif defined(__i386)
+ this->ObjectDirArch = "i386";
+#else
+ this->ObjectDirArch = "";
+#endif
+ }
+}
+
void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
std::vector<cmXCodeObject*>& targets)
{
@@ -3719,15 +3736,7 @@ void cmGlobalXCodeGenerator::ComputeTargetObjectDirectory(
std::string configName = this->GetCMakeCFGIntDir();
std::string dir =
this->GetObjectsNormalDirectory("$(PROJECT_NAME)", configName, gt);
- if (this->XcodeVersion >= 21) {
- dir += "$(CURRENT_ARCH)/";
- } else {
-#ifdef __ppc__
- dir += "ppc/";
-#endif
-#ifdef __i386
- dir += "i386/";
-#endif
- }
+ dir += this->ObjectDirArch;
+ dir += "/";
gt->ObjectDirectory = dir;
}
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index beb789b..2cd9985 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -241,6 +241,7 @@ private:
const cmGeneratorTarget* t) const;
void ComputeArchitectures(cmMakefile* mf);
+ void ComputeObjectDirArch();
void addObject(cmXCodeObject* obj);
std::string PostBuildMakeTarget(std::string const& tName,
@@ -263,6 +264,7 @@ private:
std::map<std::string, cmXCodeObject*> FileRefs;
std::map<cmGeneratorTarget const*, cmXCodeObject*> XCodeObjectMap;
std::vector<std::string> Architectures;
+ std::string ObjectDirArch;
std::string GeneratorToolset;
};