diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-06-30 17:44:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-07-03 11:43:18 (GMT) |
commit | 7a969fe21d736b6c6755b5dc7a105f1427242cdd (patch) | |
tree | e5049985a624ff703b52dcff17fad5f60cfbff8c /Source/cmGlobalGenerator.cxx | |
parent | 19f7588d3d715fdf3c32669fc756e2c68fbf1da5 (diff) | |
download | CMake-7a969fe21d736b6c6755b5dc7a105f1427242cdd.zip CMake-7a969fe21d736b6c6755b5dc7a105f1427242cdd.tar.gz CMake-7a969fe21d736b6c6755b5dc7a105f1427242cdd.tar.bz2 |
cmMakefile: Refactor API to better handle empty config values
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 6001999..a0cee0e 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -313,19 +313,16 @@ bool cmGlobalGenerator::CheckTargetsForMissingSources() const } } - std::vector<std::string> configs; - target->Makefile->GetConfigurations(configs); + std::vector<std::string> configs = + target->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); std::vector<cmSourceFile*> srcs; - if (configs.empty()) { - target->GetSourceFiles(srcs, ""); - } else { - for (std::string const& config : configs) { - target->GetSourceFiles(srcs, config); - if (!srcs.empty()) { - break; - } + for (std::string const& config : configs) { + target->GetSourceFiles(srcs, config); + if (!srcs.empty()) { + break; } } + if (srcs.empty()) { std::ostringstream e; e << "No SOURCES given to target: " << target->GetName(); @@ -349,7 +346,8 @@ bool cmGlobalGenerator::CheckTargetsForType() const if (target->GetType() == cmStateEnums::EXECUTABLE && target->GetPropertyAsBool("WIN32_EXECUTABLE")) { std::vector<std::string> const& configs = - target->Makefile->GetGeneratorConfigs(); + target->Makefile->GetGeneratorConfigs( + cmMakefile::IncludeEmptyConfig); for (std::string const& config : configs) { if (target->GetLinkerLanguage(config) == "Swift") { this->GetCMakeInstance()->IssueMessage( @@ -1701,8 +1699,8 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo() cmPolicies::PolicyStatus polSt = mf->GetPolicyStatus(cmPolicies::CMP0043); if (polSt == cmPolicies::WARN || polSt == cmPolicies::OLD) { - std::vector<std::string> configs; - mf->GetConfigurations(configs); + std::vector<std::string> configs = + mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig); for (std::string const& c : configs) { std::string defPropName = @@ -3127,7 +3125,8 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target) fout << "# Source files and their labels\n"; std::vector<cmSourceFile*> sources; std::vector<std::string> const& configs = - target->Target->GetMakefile()->GetGeneratorConfigs(); + target->Target->GetMakefile()->GetGeneratorConfigs( + cmMakefile::IncludeEmptyConfig); for (std::string const& c : configs) { target->GetSourceFiles(sources, c); } @@ -3226,8 +3225,9 @@ bool cmGlobalGenerator::GenerateCPackPropertiesFile() const auto& lg = this->LocalGenerators[0]; cmMakefile* mf = lg->GetMakefile(); - std::vector<std::string> configs; - std::string config = mf->GetConfigurations(configs, false); + std::vector<std::string> configs = + mf->GetGeneratorConfigs(cmMakefile::OnlyMultiConfig); + std::string config = mf->GetDefaultConfiguration(); std::string path = cmStrCat(this->CMakeInstance->GetHomeOutputDirectory(), "/CPackProperties.cmake"); |