Teach check for single-language targets to consider all configurations

This commit is contained in:
Brad King
2019-10-04 10:42:03 -04:00
parent 324988a6b1
commit bcaecf6bcd
2 changed files with 2 additions and 4 deletions

View File

@@ -6356,8 +6356,7 @@ bool cmGeneratorTarget::IsCSharpOnly() const
this->GetType() != cmStateEnums::EXECUTABLE) { this->GetType() != cmStateEnums::EXECUTABLE) {
return false; return false;
} }
std::set<std::string> languages; std::set<std::string> languages = this->GetAllConfigCompileLanguages();
this->GetLanguages(languages, "");
// Consider an explicit linker language property, but *not* the // Consider an explicit linker language property, but *not* the
// computed linker language that may depend on linked targets. // computed linker language that may depend on linked targets.
const char* linkLang = this->GetProperty("LINKER_LANGUAGE"); const char* linkLang = this->GetProperty("LINKER_LANGUAGE");

View File

@@ -810,8 +810,7 @@ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(
// If there's only one source language, Fortran has to be used // If there's only one source language, Fortran has to be used
// in order for the sources to compile. // in order for the sources to compile.
std::set<std::string> languages; std::set<std::string> languages = gt->GetAllConfigCompileLanguages();
gt->GetLanguages(languages, "");
// Consider an explicit linker language property, but *not* the // Consider an explicit linker language property, but *not* the
// computed linker language that may depend on linked targets. // computed linker language that may depend on linked targets.
// This allows the project to control the language choice in // This allows the project to control the language choice in