summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-07-27 13:53:36 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-07-27 13:53:52 (GMT)
commite781d92de56e0944b201ccb17ebb62117e05e1c2 (patch)
tree6d9c8bf1d75bb5735287fa0c72dda8cbf83b2325
parent3891b5a06fb98ca3c948e968ca7afee051ec2842 (diff)
parentfeeb9ae4ba8c162a84d9f7eb65ddde35eb9329a1 (diff)
downloadCMake-e781d92de56e0944b201ccb17ebb62117e05e1c2.zip
CMake-e781d92de56e0944b201ccb17ebb62117e05e1c2.tar.gz
CMake-e781d92de56e0944b201ccb17ebb62117e05e1c2.tar.bz2
Merge topic 'vs-fuzzer'
feeb9ae4ba VS: Add support for (lib)fuzzer /fsanitize=fuzzer flag Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7471
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx9
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index a00cd2b..f17a654 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1523,6 +1523,10 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
this->ASanEnabledConfigurations.end()) {
e1.Element("EnableAsan", "true");
}
+ if (this->FuzzerEnabledConfigurations.find(config) !=
+ this->FuzzerEnabledConfigurations.end()) {
+ e1.Element("EnableFuzzer", "true");
+ }
{
auto s = this->SpectreMitigation.find(config);
if (s != this->SpectreMitigation.end()) {
@@ -3148,6 +3152,11 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
this->ASanEnabledConfigurations.insert(configName);
}
+ // Check if (lib)Fuzzer is enabled.
+ if (flags.find("/fsanitize=fuzzer") != std::string::npos) {
+ this->FuzzerEnabledConfigurations.insert(configName);
+ }
+
// Precompile Headers
std::string pchHeader =
this->GeneratorTarget->GetPchHeader(configName, linkLanguage);
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 8d777a3..17dcecd 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -231,6 +231,7 @@ private:
bool TargetCompileAsWinRT;
std::set<std::string> IPOEnabledConfigurations;
std::set<std::string> ASanEnabledConfigurations;
+ std::set<std::string> FuzzerEnabledConfigurations;
std::map<std::string, std::string> SpectreMitigation;
cmGlobalVisualStudio10Generator* const GlobalGenerator;
cmLocalVisualStudio10Generator* const LocalGenerator;