summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-27 14:42:38 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-07-27 14:42:44 (GMT)
commite19a62e28bc73d419c5889d71cd4a396a9060ad8 (patch)
tree14bd83c328810bfe815e1154dfb8724b6675ad90 /Source
parent16327086f020e5a2f4267e327e27b50b73e131ca (diff)
parentc4109a1bc88f8e3b4ff93de6b784ab57149546bc (diff)
downloadCMake-e19a62e28bc73d419c5889d71cd4a396a9060ad8.zip
CMake-e19a62e28bc73d419c5889d71cd4a396a9060ad8.tar.gz
CMake-e19a62e28bc73d419c5889d71cd4a396a9060ad8.tar.bz2
Merge topic 'vs-lang-flags' into release-3.18
c4109a1bc8 VS: Restore toleration of target-wide -TP flag with MSVC Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5051
Diffstat (limited to 'Source')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index a3ccd2b..a8e424d 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2884,6 +2884,12 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
clOptions.RemoveFlag("SpectreMitigation");
}
+ // Remove any target-wide -TC or -TP flag added by the project.
+ // Such flags are unnecessary and break our model of language selection.
+ if (langForClCompile == "C" || langForClCompile == "CXX") {
+ clOptions.RemoveFlag("CompileAs");
+ }
+
this->ClOptions[configName] = std::move(pOptions);
return true;
}