Commit 70728398 authored by Brad King's avatar Brad King
Browse files

VS: Use AddLanguageFlags to de-duplicate CMAKE_<LANG>_FLAGS* lookup

parent 8ca1b262
...@@ -662,14 +662,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration( ...@@ -662,14 +662,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
langForClCompile = linkLanguage; langForClCompile = linkLanguage;
if (langForClCompile == "C" || langForClCompile == "CXX" || if (langForClCompile == "C" || langForClCompile == "CXX" ||
langForClCompile == "Fortran") { langForClCompile == "Fortran") {
std::string baseFlagVar = "CMAKE_"; this->AddLanguageFlags(flags, target, langForClCompile, configName);
baseFlagVar += langForClCompile;
baseFlagVar += "_FLAGS";
flags = this->Makefile->GetRequiredDefinition(baseFlagVar);
std::string flagVar =
baseFlagVar + std::string("_") + cmSystemTools::UpperCase(configName);
flags += " ";
flags += this->Makefile->GetRequiredDefinition(flagVar);
} }
// set the correct language // set the correct language
if (linkLanguage == "C") { if (linkLanguage == "C") {
......
...@@ -2540,14 +2540,8 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( ...@@ -2540,14 +2540,8 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
} }
this->LangForClCompile = langForClCompile; this->LangForClCompile = langForClCompile;
if (!langForClCompile.empty()) { if (!langForClCompile.empty()) {
std::string baseFlagVar = "CMAKE_"; this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
baseFlagVar += langForClCompile; langForClCompile, configName);
baseFlagVar += "_FLAGS";
flags = this->Makefile->GetRequiredDefinition(baseFlagVar);
std::string flagVar =
baseFlagVar + "_" + cmSystemTools::UpperCase(configName);
flags += " ";
flags += this->Makefile->GetRequiredDefinition(flagVar);
this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget, this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget,
langForClCompile, configName); langForClCompile, configName);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment