summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorDubach, Joev <Joev.Dubach@nuance.com>2022-07-27 20:08:16 (GMT)
committerBrad King <brad.king@kitware.com>2022-07-27 20:51:15 (GMT)
commit9dbcfb8fdd3d98080bc658846d4ed50d990736c1 (patch)
tree9cff9c394ea33e50b5d4d56bd7d2cea37338c65b /Source/cmVisualStudio10TargetGenerator.cxx
parentf44b79ad9bc24e84eabbf104f8a99c948dbaf326 (diff)
downloadCMake-9dbcfb8fdd3d98080bc658846d4ed50d990736c1.zip
CMake-9dbcfb8fdd3d98080bc658846d4ed50d990736c1.tar.gz
CMake-9dbcfb8fdd3d98080bc658846d4ed50d990736c1.tar.bz2
MSVC: Recognize -XYZ as well as /XYZ when parsing MS tool command lines
Fixes: #23772
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index f17a654..66b91cb 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -3148,12 +3148,14 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
}
// Check if ASan is enabled.
- if (flags.find("/fsanitize=address") != std::string::npos) {
+ if (flags.find("/fsanitize=address") != std::string::npos ||
+ flags.find("-fsanitize=address") != std::string::npos) {
this->ASanEnabledConfigurations.insert(configName);
}
// Check if (lib)Fuzzer is enabled.
- if (flags.find("/fsanitize=fuzzer") != std::string::npos) {
+ if (flags.find("/fsanitize=fuzzer") != std::string::npos ||
+ flags.find("-fsanitize=fuzzer") != std::string::npos) {
this->FuzzerEnabledConfigurations.insert(configName);
}
@@ -3198,7 +3200,9 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
// anymore, because cmGeneratorTarget may not be aware that the
// target uses C++/CLI.
if (flags.find("/clr") != std::string::npos ||
- defineFlags.find("/clr") != std::string::npos) {
+ flags.find("-clr") != std::string::npos ||
+ defineFlags.find("/clr") != std::string::npos ||
+ defineFlags.find("-clr") != std::string::npos) {
if (configName == this->Configurations[0]) {
std::string message = "For the target \"" +
this->GeneratorTarget->GetName() +