mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 19:43:23 +08:00
VS: Add support for (lib)fuzzer /fsanitize=fuzzer flag
This commit is contained in:
@@ -1557,6 +1557,10 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
|
|||||||
this->ASanEnabledConfigurations.end()) {
|
this->ASanEnabledConfigurations.end()) {
|
||||||
e1.Element("EnableAsan", "true");
|
e1.Element("EnableAsan", "true");
|
||||||
}
|
}
|
||||||
|
if (this->FuzzerEnabledConfigurations.find(config) !=
|
||||||
|
this->FuzzerEnabledConfigurations.end()) {
|
||||||
|
e1.Element("EnableFuzzer", "true");
|
||||||
|
}
|
||||||
{
|
{
|
||||||
auto s = this->SpectreMitigation.find(config);
|
auto s = this->SpectreMitigation.find(config);
|
||||||
if (s != this->SpectreMitigation.end()) {
|
if (s != this->SpectreMitigation.end()) {
|
||||||
@@ -3315,6 +3319,11 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
|
|||||||
this->ASanEnabledConfigurations.insert(configName);
|
this->ASanEnabledConfigurations.insert(configName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if (lib)Fuzzer is enabled.
|
||||||
|
if (flags.find("/fsanitize=fuzzer") != std::string::npos) {
|
||||||
|
this->FuzzerEnabledConfigurations.insert(configName);
|
||||||
|
}
|
||||||
|
|
||||||
// Precompile Headers
|
// Precompile Headers
|
||||||
std::string pchHeader =
|
std::string pchHeader =
|
||||||
this->GeneratorTarget->GetPchHeader(configName, linkLanguage);
|
this->GeneratorTarget->GetPchHeader(configName, linkLanguage);
|
||||||
|
@@ -231,6 +231,7 @@ private:
|
|||||||
bool TargetCompileAsWinRT;
|
bool TargetCompileAsWinRT;
|
||||||
std::set<std::string> IPOEnabledConfigurations;
|
std::set<std::string> IPOEnabledConfigurations;
|
||||||
std::set<std::string> ASanEnabledConfigurations;
|
std::set<std::string> ASanEnabledConfigurations;
|
||||||
|
std::set<std::string> FuzzerEnabledConfigurations;
|
||||||
std::map<std::string, std::string> SpectreMitigation;
|
std::map<std::string, std::string> SpectreMitigation;
|
||||||
cmGlobalVisualStudio10Generator* const GlobalGenerator;
|
cmGlobalVisualStudio10Generator* const GlobalGenerator;
|
||||||
cmLocalVisualStudio10Generator* const LocalGenerator;
|
cmLocalVisualStudio10Generator* const LocalGenerator;
|
||||||
|
Reference in New Issue
Block a user