diff options
author | Brad King <brad.king@kitware.com> | 2023-03-14 21:01:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-15 14:11:37 (GMT) |
commit | 93afe804ce4949823dc4521d555811720afd7783 (patch) | |
tree | 44a3c3a094b1df4a25ddc9aec5bea238d7ba96b2 /Source | |
parent | 1ec4c6579117634ddb20962cdb63313dbf79887e (diff) | |
download | CMake-93afe804ce4949823dc4521d555811720afd7783.zip CMake-93afe804ce4949823dc4521d555811720afd7783.tar.gz CMake-93afe804ce4949823dc4521d555811720afd7783.tar.bz2 |
cmGeneratorTarget: Convert GetAppleArchs output argument to return value
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFileAPICodemodel.cxx | 4 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 8 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.h | 3 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 8 |
7 files changed, 19 insertions, 20 deletions
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index d3683d4..6d77f85 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -1355,8 +1355,8 @@ CompileData Target::BuildCompileData(cmSourceFile* sf) } // Add precompile headers compile options. - std::vector<std::string> architectures; - this->GT->GetAppleArchs(this->Config, architectures); + std::vector<std::string> architectures = + this->GT->GetAppleArchs(this->Config); if (architectures.empty()) { architectures.emplace_back(); } diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 4cfa1d7..541c2a6 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3448,11 +3448,12 @@ std::string cmGeneratorTarget::GetCompilePDBDirectory( return ""; } -void cmGeneratorTarget::GetAppleArchs(const std::string& config, - std::vector<std::string>& archVec) const +std::vector<std::string> cmGeneratorTarget::GetAppleArchs( + std::string const& config) const { + std::vector<std::string> archVec; if (!this->IsApple()) { - return; + return archVec; } cmValue archs = nullptr; if (!config.empty()) { @@ -3469,6 +3470,7 @@ void cmGeneratorTarget::GetAppleArchs(const std::string& config, if (archVec.empty()) { this->Makefile->GetDefExpandList("_CMAKE_APPLE_ARCHS_DEFAULT", archVec); } + return archVec; } void cmGeneratorTarget::AddExplicitLanguageFlags(std::string& flags, diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 5d26191..7c1ff72 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -484,8 +484,7 @@ public: holding object files for the given configuration. */ std::string GetObjectDirectory(std::string const& config) const; - void GetAppleArchs(const std::string& config, - std::vector<std::string>& archVec) const; + std::vector<std::string> GetAppleArchs(std::string const& config) const; void AddExplicitLanguageFlags(std::string& flags, cmSourceFile const& sf) const; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 5b3ac60..6fca5f4 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2513,8 +2513,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, } // Set target-specific architectures. - std::vector<std::string> archs; - gtgt->GetAppleArchs(configName, archs); + std::vector<std::string> archs = gtgt->GetAppleArchs(configName); if (!archs.empty()) { // Enable ARCHS attribute. diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index bd7eb3f..6fc4597 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1873,8 +1873,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags, { // Only add Apple specific flags on Apple platforms if (target->IsApple() && this->EmitUniversalBinaryFlags) { - std::vector<std::string> archs; - target->GetAppleArchs(config, archs); + std::vector<std::string> archs = target->GetAppleArchs(config); if (!archs.empty() && (lang == "C" || lang == "CXX" || lang == "OBJC" || lang == "OBJCXX" || lang == "ASM")) { @@ -2594,7 +2593,7 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target) std::vector<std::string> architectures; if (!this->GetGlobalGenerator()->IsXcode()) { - target->GetAppleArchs(config, architectures); + architectures = target->GetAppleArchs(config); } if (architectures.empty()) { architectures.emplace_back(); diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 2ead739..a7e5eca 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -541,8 +541,8 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags() *this->FlagFileStream << language << "_DEFINES = " << defines << "\n\n"; *this->FlagFileStream << language << "_INCLUDES = " << includes << "\n\n"; - std::vector<std::string> architectures; - this->GeneratorTarget->GetAppleArchs(this->GetConfigName(), architectures); + std::vector<std::string> architectures = + this->GeneratorTarget->GetAppleArchs(this->GetConfigName()); architectures.emplace_back(); for (const std::string& arch : architectures) { @@ -671,8 +671,8 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( std::string configUpper = cmSystemTools::UpperCase(config); // Add precompile headers dependencies - std::vector<std::string> architectures; - this->GeneratorTarget->GetAppleArchs(config, architectures); + std::vector<std::string> architectures = + this->GeneratorTarget->GetAppleArchs(config); if (architectures.empty()) { architectures.emplace_back(); } diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index dc56142..ce5e501 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -169,9 +169,9 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject( cmSourceFile const* source, const std::string& language, const std::string& config) { - std::vector<std::string> architectures; 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()) { architectures.emplace_back(); } @@ -1390,8 +1390,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( // Add precompile headers dependencies std::vector<std::string> depList; - std::vector<std::string> architectures; - this->GeneratorTarget->GetAppleArchs(config, architectures); + std::vector<std::string> architectures = + this->GeneratorTarget->GetAppleArchs(config); if (architectures.empty()) { architectures.emplace_back(); } |