mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 06:09:52 -06:00
VS: Use AddLanguageFlags to de-duplicate CMAKE_<LANG>_FLAGS* lookup
This commit is contained in:
@@ -662,14 +662,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
|
||||
langForClCompile = linkLanguage;
|
||||
if (langForClCompile == "C" || langForClCompile == "CXX" ||
|
||||
langForClCompile == "Fortran") {
|
||||
std::string baseFlagVar = "CMAKE_";
|
||||
baseFlagVar += langForClCompile;
|
||||
baseFlagVar += "_FLAGS";
|
||||
flags = this->Makefile->GetRequiredDefinition(baseFlagVar);
|
||||
std::string flagVar =
|
||||
baseFlagVar + std::string("_") + cmSystemTools::UpperCase(configName);
|
||||
flags += " ";
|
||||
flags += this->Makefile->GetRequiredDefinition(flagVar);
|
||||
this->AddLanguageFlags(flags, target, langForClCompile, configName);
|
||||
}
|
||||
// set the correct language
|
||||
if (linkLanguage == "C") {
|
||||
|
||||
@@ -2540,14 +2540,8 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
|
||||
}
|
||||
this->LangForClCompile = langForClCompile;
|
||||
if (!langForClCompile.empty()) {
|
||||
std::string baseFlagVar = "CMAKE_";
|
||||
baseFlagVar += langForClCompile;
|
||||
baseFlagVar += "_FLAGS";
|
||||
flags = this->Makefile->GetRequiredDefinition(baseFlagVar);
|
||||
std::string flagVar =
|
||||
baseFlagVar + "_" + cmSystemTools::UpperCase(configName);
|
||||
flags += " ";
|
||||
flags += this->Makefile->GetRequiredDefinition(flagVar);
|
||||
this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
|
||||
langForClCompile, configName);
|
||||
this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget,
|
||||
langForClCompile, configName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user