diff --git a/src/dawn/common/BUILD.gn b/src/dawn/common/BUILD.gn index d5b0598065..4dc4d69465 100644 --- a/src/dawn/common/BUILD.gn +++ b/src/dawn/common/BUILD.gn @@ -49,8 +49,13 @@ config("internal_config") { } if (use_fuzzing_engine) { - # Does a hard abort when an assertion fails so that fuzzers catch and parse the failure. - defines += [ "DAWN_ABORT_ON_ASSERT" ] + defines += [ + # Does a hard abort when an assertion fails so that fuzzers catch and parse the failure. + "DAWN_ABORT_ON_ASSERT", + + # Disable logging to make fuzzing more efficient. + "DAWN_DISABLE_LOGGING", + ] } if (dawn_enable_d3d12) { diff --git a/src/dawn/common/Log.cpp b/src/dawn/common/Log.cpp index 799b8f99e3..6034fe14d9 100644 --- a/src/dawn/common/Log.cpp +++ b/src/dawn/common/Log.cpp @@ -71,6 +71,11 @@ LogMessage::LogMessage(LogMessage&& other) = default; LogMessage& LogMessage::operator=(LogMessage&& other) = default; LogMessage::~LogMessage() { +#if defined(DAWN_DISABLE_LOGGING) + // Don't print logs to make fuzzing more efficient. Implemented as + // an early return to avoid warnings about unused member variables. + return; +#endif std::string fullMessage = mStream.str(); // If this message has been moved, its stream is empty.