diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake index e81162b65..b4e5b3a1a 100644 --- a/cmake/CompilerWarnings.cmake +++ b/cmake/CompilerWarnings.cmake @@ -68,7 +68,13 @@ function(set_file_warnings) # -Wimplicit-fallthrough # warn when a missing break causes control flow to continue at the next case in a switch statement (disabled until better compiler support for explicit fallthrough is available) ${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) diff --git a/cmake/Config.cmake b/cmake/Config.cmake index dad681289..2ce5ac46d 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -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)