Disable /WX for clang-cl

This commit is contained in:
Bambo-Borris 2022-06-05 20:05:10 +01:00 committed by Lukas Dürrenberger
parent b158bc1f94
commit 12c091e0ce
2 changed files with 12 additions and 1 deletions

View File

@ -69,6 +69,12 @@ function(set_file_warnings)
${NON_ANDROID_CLANG_AND_GCC_WARNINGS}
)
# 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(WARNINGS_AS_ERRORS)
set(CLANG_AND_GCC_WARNINGS ${CLANG_AND_GCC_WARNINGS} -Werror)
set(MSVC_WARNINGS ${MSVC_WARNINGS} /WX)

View File

@ -107,6 +107,11 @@ if(MSVC)
elseif(MSVC_VERSION LESS_EQUAL 1939)
set(SFML_MSVC_VERSION 17)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(SFML_COMPILER_CLANG_CL 1)
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(SFML_COMPILER_CLANG 1)