Enable warnings as errors for clang-cl.exe

This commit is contained in:
Chris Thrasher 2022-12-10 23:36:48 -07:00
parent e54bf87e9b
commit 75642ef7aa

View File

@ -6,12 +6,6 @@
function(set_target_warnings target) function(set_target_warnings target)
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" TRUE) option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" TRUE)
# For now if we're using MSVC-like clang interface on Windows
# we'll disable warnings as errors
if(SFML_OS_WINDOWS AND SFML_COMPILER_CLANG_CL)
set(WARNINGS_AS_ERRORS FALSE)
endif()
if(SFML_COMPILER_MSVC) if(SFML_COMPILER_MSVC)
target_compile_options(${target} PRIVATE target_compile_options(${target} PRIVATE
$<$<BOOL:${WARNINGS_AS_ERRORS}>:/WX> $<$<BOOL:${WARNINGS_AS_ERRORS}>:/WX>
@ -79,7 +73,7 @@ function(set_target_warnings target)
) )
endif() endif()
if(SFML_COMPILER_CLANG) if(SFML_COMPILER_CLANG OR SFML_COMPILER_CLANG_CL)
target_compile_options(${target} PRIVATE target_compile_options(${target} PRIVATE
-Wno-unknown-warning-option # do not warn on GCC-specific warning diagnostic pragmas -Wno-unknown-warning-option # do not warn on GCC-specific warning diagnostic pragmas
) )