mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 04:40:18 -05:00
MSVC: Recognize -XYZ as well as /XYZ when parsing MS tool command lines
Fixes: #23772
This commit is contained in:
@@ -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() +
|
||||
|
||||
Reference in New Issue
Block a user