Skip to content

Commit 5ce36b2

Browse files
enable some warnings to pass binskim
Signed-off-by: Zhu, Shaojie <[email protected]>
1 parent dfee500 commit 5ce36b2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,8 @@ if ( LLVM_COMPILER_IS_GCC_COMPATIBLE AND LLVM_ENABLE_MODULES )
684684
endif()
685685
endif( LLVM_COMPILER_IS_GCC_COMPATIBLE AND LLVM_ENABLE_MODULES )
686686

687+
option(LLVM_ENABLE_WARNINGS_FOR_PASS_BINSKIM "Enable compiler warnings for pass binskim." OFF)
688+
687689
if (MSVC)
688690
if (NOT CLANG_CL)
689691
set(msvc_warning_flags
@@ -746,6 +748,13 @@ if (MSVC)
746748
)
747749
endif(NOT CLANG_CL)
748750

751+
# Remove -wd4146 -wd4244 -wd4267 to pass Binskim
752+
if(LLVM_ENABLE_WARNINGS_FOR_PASS_BINSKIM)
753+
string(REPLACE "-wd4146" "" msvc_warning_flags "${msvc_warning_flags}")
754+
string(REPLACE "-wd4244" "" msvc_warning_flags "${msvc_warning_flags}")
755+
string(REPLACE "-wd4267" "" msvc_warning_flags "${msvc_warning_flags}")
756+
endif()
757+
749758
# Enable warnings
750759
if (LLVM_ENABLE_WARNINGS)
751760
# Put /W4 in front of all the -we flags. cl.exe doesn't care, but for

0 commit comments

Comments
 (0)