Skip to content

Commit 723d079

Browse files
enable some warnings to pass binskim
Signed-off-by: Zhu, Shaojie <[email protected]>
1 parent 9b470b8 commit 723d079

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
@@ -701,6 +701,8 @@ if ( LLVM_COMPILER_IS_GCC_COMPATIBLE AND LLVM_ENABLE_MODULES )
701701
append("${module_flags}" CMAKE_CXX_FLAGS)
702702
endif( LLVM_COMPILER_IS_GCC_COMPATIBLE AND LLVM_ENABLE_MODULES )
703703

704+
option(LLVM_ENABLE_WARNINGS_FOR_PASS_BINSKIM "Enable compiler warnings for pass binskim." OFF)
705+
704706
if (MSVC)
705707
if (NOT CLANG_CL)
706708
set(msvc_warning_flags
@@ -763,6 +765,13 @@ if (MSVC)
763765
)
764766
endif(NOT CLANG_CL)
765767

768+
# Remove -wd4146 -wd4244 -wd4267 to pass Binskim
769+
if(LLVM_ENABLE_WARNINGS_FOR_PASS_BINSKIM)
770+
string(REPLACE "-wd4146" "" msvc_warning_flags "${msvc_warning_flags}")
771+
string(REPLACE "-wd4244" "" msvc_warning_flags "${msvc_warning_flags}")
772+
string(REPLACE "-wd4267" "" msvc_warning_flags "${msvc_warning_flags}")
773+
endif()
774+
766775
# Enable warnings
767776
if (LLVM_ENABLE_WARNINGS)
768777
# Put /W4 in front of all the -we flags. cl.exe doesn't care, but for

0 commit comments

Comments
 (0)