From 0745ea97e0fe0bfb8a4e56ac9611e0d4b1a8e410 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Thu, 7 Sep 2023 07:57:10 -0600 Subject: [PATCH] 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. --- CMakePresets.json | 3 ++- cmake/CompilerWarnings.cmake | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index c47ab3c1..a5b31fd4 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -9,7 +9,8 @@ "CMAKE_CXX_EXTENSIONS": "OFF", "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", "SFML_BUILD_EXAMPLES": "ON", - "SFML_BUILD_TEST_SUITE": "ON" + "SFML_BUILD_TEST_SUITE": "ON", + "SFML_WARNINGS_AS_ERRORS": "ON" } } ] diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake index 5bb50019..60aa652e 100644 --- a/cmake/CompilerWarnings.cmake +++ b/cmake/CompilerWarnings.cmake @@ -4,7 +4,7 @@ # Helper function to enable compiler warnings for a specific 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) target_compile_options(${target} PRIVATE