diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index e519d78ec5..7ba347177a 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -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") { diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 8804e6c960..5195957c65 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -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); }