mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-22 22:51:41 -06:00
Xcode: Refactor object directory name computation
Factor out a helper function to compute the object directory name architecture component.
This commit is contained in:
@@ -152,6 +152,8 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(cmake* cm,
|
|||||||
this->CurrentLocalGenerator = 0;
|
this->CurrentLocalGenerator = 0;
|
||||||
this->XcodeBuildCommandInitialized = false;
|
this->XcodeBuildCommandInitialized = false;
|
||||||
|
|
||||||
|
this->ComputeObjectDirArch();
|
||||||
|
|
||||||
cm->GetState()->SetIsGeneratorMultiConfig(true);
|
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(
|
void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
|
||||||
std::vector<cmXCodeObject*>& targets)
|
std::vector<cmXCodeObject*>& targets)
|
||||||
{
|
{
|
||||||
@@ -3719,15 +3736,7 @@ void cmGlobalXCodeGenerator::ComputeTargetObjectDirectory(
|
|||||||
std::string configName = this->GetCMakeCFGIntDir();
|
std::string configName = this->GetCMakeCFGIntDir();
|
||||||
std::string dir =
|
std::string dir =
|
||||||
this->GetObjectsNormalDirectory("$(PROJECT_NAME)", configName, gt);
|
this->GetObjectsNormalDirectory("$(PROJECT_NAME)", configName, gt);
|
||||||
if (this->XcodeVersion >= 21) {
|
dir += this->ObjectDirArch;
|
||||||
dir += "$(CURRENT_ARCH)/";
|
dir += "/";
|
||||||
} else {
|
|
||||||
#ifdef __ppc__
|
|
||||||
dir += "ppc/";
|
|
||||||
#endif
|
|
||||||
#ifdef __i386
|
|
||||||
dir += "i386/";
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
gt->ObjectDirectory = dir;
|
gt->ObjectDirectory = dir;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -241,6 +241,7 @@ private:
|
|||||||
const cmGeneratorTarget* t) const;
|
const cmGeneratorTarget* t) const;
|
||||||
|
|
||||||
void ComputeArchitectures(cmMakefile* mf);
|
void ComputeArchitectures(cmMakefile* mf);
|
||||||
|
void ComputeObjectDirArch();
|
||||||
|
|
||||||
void addObject(cmXCodeObject* obj);
|
void addObject(cmXCodeObject* obj);
|
||||||
std::string PostBuildMakeTarget(std::string const& tName,
|
std::string PostBuildMakeTarget(std::string const& tName,
|
||||||
@@ -263,6 +264,7 @@ private:
|
|||||||
std::map<std::string, cmXCodeObject*> FileRefs;
|
std::map<std::string, cmXCodeObject*> FileRefs;
|
||||||
std::map<cmGeneratorTarget const*, cmXCodeObject*> XCodeObjectMap;
|
std::map<cmGeneratorTarget const*, cmXCodeObject*> XCodeObjectMap;
|
||||||
std::vector<std::string> Architectures;
|
std::vector<std::string> Architectures;
|
||||||
|
std::string ObjectDirArch;
|
||||||
std::string GeneratorToolset;
|
std::string GeneratorToolset;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user