VS: Use tool-specific flag table for COMPILE_FLAGS parsing

Fixes: #14710
This commit is contained in:
Peter Ivanyi
2017-05-03 00:07:26 +01:00
committed by Brad King
parent da9076e422
commit ea6bb8293f

View File

@@ -1943,9 +1943,24 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
hasFlags = true;
cmGlobalVisualStudio10Generator* gg =
static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator);
cmIDEFlagTable const* flagtable = CM_NULLPTR;
const std::string& srclang = source->GetLanguage();
if (srclang == "C" || srclang == "CXX") {
flagtable = gg->GetClFlagTable();
} else if (srclang == "ASM_MASM" &&
this->GlobalGenerator->IsMasmEnabled()) {
flagtable = gg->GetMasmFlagTable();
} else if (lang == "ASM_NASM" &&
this->GlobalGenerator->IsNasmEnabled()) {
flagtable = gg->GetNasmFlagTable();
} else if (srclang == "RC") {
flagtable = gg->GetRcFlagTable();
} else if (srclang == "CSharp") {
flagtable = gg->GetCSharpFlagTable();
}
cmVisualStudioGeneratorOptions clOptions(
this->LocalGenerator, cmVisualStudioGeneratorOptions::Compiler,
gg->GetClFlagTable(), 0, this);
flagtable, 0, this);
if (compileAs) {
clOptions.AddFlag("CompileAs", compileAs);
}