Disable warnings as errors by default

This is not the best default value because it imposes additional
requirements on user builds that are not strictly necessary. This
has caused many complaints in the past as people encounter build
failures that are merely due to warnings and not hard compiler
errors.

Changing this default value emakes it more likely that someone trying
to use SFML can use it without issue.
This commit is contained in:
Chris Thrasher 2023-09-07 07:57:10 -06:00
parent 332d11be41
commit 0745ea97e0
2 changed files with 3 additions and 2 deletions

View File

@ -9,7 +9,8 @@
"CMAKE_CXX_EXTENSIONS": "OFF", "CMAKE_CXX_EXTENSIONS": "OFF",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON", "CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"SFML_BUILD_EXAMPLES": "ON", "SFML_BUILD_EXAMPLES": "ON",
"SFML_BUILD_TEST_SUITE": "ON" "SFML_BUILD_TEST_SUITE": "ON",
"SFML_WARNINGS_AS_ERRORS": "ON"
} }
} }
] ]

View File

@ -4,7 +4,7 @@
# Helper function to enable compiler warnings for a specific target # Helper function to enable compiler warnings for a specific target
function(set_target_warnings target) function(set_target_warnings target)
option(SFML_WARNINGS_AS_ERRORS "Treat compiler warnings as errors" TRUE) option(SFML_WARNINGS_AS_ERRORS "Treat compiler warnings as errors" FALSE)
if(SFML_COMPILER_MSVC) if(SFML_COMPILER_MSVC)
target_compile_options(${target} PRIVATE target_compile_options(${target} PRIVATE