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)
commitea8bb8a2a7d491b2fd8d79e98f5b50ca55ab8d70 (patch)
treead9f563b166c72eea8ae9eb975d3995ed1e928a1 /Source
parent11cf196fd2c8eca6427cf65755895641c60fe1fe (diff)
parenta33a4ec68bbaf8e1a83c4fa241ce77a3634e73d6 (diff)
downloadCMake-ea8bb8a2a7d491b2fd8d79e98f5b50ca55ab8d70.zip
CMake-ea8bb8a2a7d491b2fd8d79e98f5b50ca55ab8d70.tar.gz
CMake-ea8bb8a2a7d491b2fd8d79e98f5b50ca55ab8d70.tar.bz2
Merge topic 'vs-lang-flags'
a33a4ec68b Merge branch 'backport-vs-lang-flags' into vs-lang-flags 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 f291cbd..a06dab3 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2919,6 +2919,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;
}