summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorPeter Ivanyi <pivanyi71@gmail.com>2017-05-02 23:07:26 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-03 16:48:53 (GMT)
commitea6bb8293f50ecc93f42b6ea6525baa0252712a5 (patch)
treec97fead69c1fc5ac9aac7d872ec2e304312bb9b9 /Source/cmVisualStudio10TargetGenerator.cxx
parentda9076e422667322ceb04afa1ff43f69bba4c879 (diff)
downloadCMake-ea6bb8293f50ecc93f42b6ea6525baa0252712a5.zip
CMake-ea6bb8293f50ecc93f42b6ea6525baa0252712a5.tar.gz
CMake-ea6bb8293f50ecc93f42b6ea6525baa0252712a5.tar.bz2
VS: Use tool-specific flag table for COMPILE_FLAGS parsing
Fixes: #14710
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 5a09718..c81ba7a 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -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);
}