llvm-project
4a907a52 - [CMake] Add LLVM_ENABLE_WARNING_SUPPRESSIONS to toggle warning suppressions (#183439)

Commit
1 day ago
[CMake] Add LLVM_ENABLE_WARNING_SUPPRESSIONS to toggle warning suppressions (#183439) This PR introduces a new opt-in CMake option `LLVM_ENABLE_WARNING_SUPPRESSIONS` (default `ON`) to toggle warning suppressions Previously, several compiler warnings were explicitly disabled using `-wd` (for MSVC) or `-Wno-...` (for GCC/Clang) flags by default. However, this causes validation failures with strict compliance scanners like BinSkim, which require builds to run without any warning suppressions to meet SDL compliance standards. This change introduces an opt-in `LLVM_ENABLE_WARNING_SUPPRESSIONS` option (default ON). When explicitly disabled (OFF), it selectively filters out the `-wd` flags for MSVC and removes all `-Wno-...` flags for GCC/Clang in HandleLLVMOptions.cmake. This ensures all compiler warnings are exposed as intended for static analysis tools while preserving the default noise-free build experience for regular users. The option has also been exported to `LLVMConfig.cmake.in` and documented in `CMake.rst`. Signed-off-by: Zhu, Shaojie <shaojie.zhu@intel.com>
Parents
Loading