mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-12 00:58:59 -05:00
cmGeneratorTarget: Convert GetAppleArchs output argument to return value
This commit is contained in:
@@ -1355,8 +1355,8 @@ CompileData Target::BuildCompileData(cmSourceFile* sf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add precompile headers compile options.
|
// Add precompile headers compile options.
|
||||||
std::vector<std::string> architectures;
|
std::vector<std::string> architectures =
|
||||||
this->GT->GetAppleArchs(this->Config, architectures);
|
this->GT->GetAppleArchs(this->Config);
|
||||||
if (architectures.empty()) {
|
if (architectures.empty()) {
|
||||||
architectures.emplace_back();
|
architectures.emplace_back();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3448,11 +3448,12 @@ std::string cmGeneratorTarget::GetCompilePDBDirectory(
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmGeneratorTarget::GetAppleArchs(const std::string& config,
|
std::vector<std::string> cmGeneratorTarget::GetAppleArchs(
|
||||||
std::vector<std::string>& archVec) const
|
std::string const& config) const
|
||||||
{
|
{
|
||||||
|
std::vector<std::string> archVec;
|
||||||
if (!this->IsApple()) {
|
if (!this->IsApple()) {
|
||||||
return;
|
return archVec;
|
||||||
}
|
}
|
||||||
cmValue archs = nullptr;
|
cmValue archs = nullptr;
|
||||||
if (!config.empty()) {
|
if (!config.empty()) {
|
||||||
@@ -3469,6 +3470,7 @@ void cmGeneratorTarget::GetAppleArchs(const std::string& config,
|
|||||||
if (archVec.empty()) {
|
if (archVec.empty()) {
|
||||||
this->Makefile->GetDefExpandList("_CMAKE_APPLE_ARCHS_DEFAULT", archVec);
|
this->Makefile->GetDefExpandList("_CMAKE_APPLE_ARCHS_DEFAULT", archVec);
|
||||||
}
|
}
|
||||||
|
return archVec;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmGeneratorTarget::AddExplicitLanguageFlags(std::string& flags,
|
void cmGeneratorTarget::AddExplicitLanguageFlags(std::string& flags,
|
||||||
|
|||||||
@@ -484,8 +484,7 @@ public:
|
|||||||
holding object files for the given configuration. */
|
holding object files for the given configuration. */
|
||||||
std::string GetObjectDirectory(std::string const& config) const;
|
std::string GetObjectDirectory(std::string const& config) const;
|
||||||
|
|
||||||
void GetAppleArchs(const std::string& config,
|
std::vector<std::string> GetAppleArchs(std::string const& config) const;
|
||||||
std::vector<std::string>& archVec) const;
|
|
||||||
|
|
||||||
void AddExplicitLanguageFlags(std::string& flags,
|
void AddExplicitLanguageFlags(std::string& flags,
|
||||||
cmSourceFile const& sf) const;
|
cmSourceFile const& sf) const;
|
||||||
|
|||||||
@@ -2513,8 +2513,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set target-specific architectures.
|
// Set target-specific architectures.
|
||||||
std::vector<std::string> archs;
|
std::vector<std::string> archs = gtgt->GetAppleArchs(configName);
|
||||||
gtgt->GetAppleArchs(configName, archs);
|
|
||||||
|
|
||||||
if (!archs.empty()) {
|
if (!archs.empty()) {
|
||||||
// Enable ARCHS attribute.
|
// Enable ARCHS attribute.
|
||||||
|
|||||||
@@ -1873,8 +1873,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
|
|||||||
{
|
{
|
||||||
// Only add Apple specific flags on Apple platforms
|
// Only add Apple specific flags on Apple platforms
|
||||||
if (target->IsApple() && this->EmitUniversalBinaryFlags) {
|
if (target->IsApple() && this->EmitUniversalBinaryFlags) {
|
||||||
std::vector<std::string> archs;
|
std::vector<std::string> archs = target->GetAppleArchs(config);
|
||||||
target->GetAppleArchs(config, archs);
|
|
||||||
if (!archs.empty() &&
|
if (!archs.empty() &&
|
||||||
(lang == "C" || lang == "CXX" || lang == "OBJC" || lang == "OBJCXX" ||
|
(lang == "C" || lang == "CXX" || lang == "OBJC" || lang == "OBJCXX" ||
|
||||||
lang == "ASM")) {
|
lang == "ASM")) {
|
||||||
@@ -2594,7 +2593,7 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
|
|||||||
|
|
||||||
std::vector<std::string> architectures;
|
std::vector<std::string> architectures;
|
||||||
if (!this->GetGlobalGenerator()->IsXcode()) {
|
if (!this->GetGlobalGenerator()->IsXcode()) {
|
||||||
target->GetAppleArchs(config, architectures);
|
architectures = target->GetAppleArchs(config);
|
||||||
}
|
}
|
||||||
if (architectures.empty()) {
|
if (architectures.empty()) {
|
||||||
architectures.emplace_back();
|
architectures.emplace_back();
|
||||||
|
|||||||
@@ -541,8 +541,8 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags()
|
|||||||
*this->FlagFileStream << language << "_DEFINES = " << defines << "\n\n";
|
*this->FlagFileStream << language << "_DEFINES = " << defines << "\n\n";
|
||||||
*this->FlagFileStream << language << "_INCLUDES = " << includes << "\n\n";
|
*this->FlagFileStream << language << "_INCLUDES = " << includes << "\n\n";
|
||||||
|
|
||||||
std::vector<std::string> architectures;
|
std::vector<std::string> architectures =
|
||||||
this->GeneratorTarget->GetAppleArchs(this->GetConfigName(), architectures);
|
this->GeneratorTarget->GetAppleArchs(this->GetConfigName());
|
||||||
architectures.emplace_back();
|
architectures.emplace_back();
|
||||||
|
|
||||||
for (const std::string& arch : architectures) {
|
for (const std::string& arch : architectures) {
|
||||||
@@ -671,8 +671,8 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|||||||
std::string configUpper = cmSystemTools::UpperCase(config);
|
std::string configUpper = cmSystemTools::UpperCase(config);
|
||||||
|
|
||||||
// Add precompile headers dependencies
|
// Add precompile headers dependencies
|
||||||
std::vector<std::string> architectures;
|
std::vector<std::string> architectures =
|
||||||
this->GeneratorTarget->GetAppleArchs(config, architectures);
|
this->GeneratorTarget->GetAppleArchs(config);
|
||||||
if (architectures.empty()) {
|
if (architectures.empty()) {
|
||||||
architectures.emplace_back();
|
architectures.emplace_back();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,9 +169,9 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject(
|
|||||||
cmSourceFile const* source, const std::string& language,
|
cmSourceFile const* source, const std::string& language,
|
||||||
const std::string& config)
|
const std::string& config)
|
||||||
{
|
{
|
||||||
std::vector<std::string> architectures;
|
|
||||||
std::unordered_map<std::string, std::string> pchSources;
|
std::unordered_map<std::string, std::string> pchSources;
|
||||||
this->GeneratorTarget->GetAppleArchs(config, architectures);
|
std::vector<std::string> architectures =
|
||||||
|
this->GeneratorTarget->GetAppleArchs(config);
|
||||||
if (architectures.empty()) {
|
if (architectures.empty()) {
|
||||||
architectures.emplace_back();
|
architectures.emplace_back();
|
||||||
}
|
}
|
||||||
@@ -1390,8 +1390,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
|
|||||||
// Add precompile headers dependencies
|
// Add precompile headers dependencies
|
||||||
std::vector<std::string> depList;
|
std::vector<std::string> depList;
|
||||||
|
|
||||||
std::vector<std::string> architectures;
|
std::vector<std::string> architectures =
|
||||||
this->GeneratorTarget->GetAppleArchs(config, architectures);
|
this->GeneratorTarget->GetAppleArchs(config);
|
||||||
if (architectures.empty()) {
|
if (architectures.empty()) {
|
||||||
architectures.emplace_back();
|
architectures.emplace_back();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user