Ensure CMake options include CSFML_ prefix

This commit is contained in:
Chris Thrasher committed 2024-09-03 10:44:50 -06:00
1 parent 34febc214f
commit cc1b6f0c45
2 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CSFML_BUILD_EXAMPLES": "ON",
"CSFML_BUILD_TEST_SUITE": "ON",
"WARNINGS_AS_ERRORS": "ON"
"CSFML_WARNINGS_AS_ERRORS": "ON"
}
}
]
+3 -3
View File
@@ -4,7 +4,7 @@
# Helper function to enable compiler warnings for a specific target
function(set_target_warnings target)
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" FALSE)
option(CSFML_WARNINGS_AS_ERRORS "Treat compiler warnings as errors" FALSE)
set(MSVC_WARNINGS
/W4 # Baseline reasonable warnings
@@ -55,10 +55,10 @@ function(set_target_warnings target)
# Disable warnings as errors when using Clang on Windows to work around deprecation warnings in Windows APIs
if(SFML_OS_WINDOWS AND (SFML_COMPILER_CLANG OR SFML_COMPILER_CLANG_CL))
set(WARNINGS_AS_ERRORS FALSE)
set(CSFML_WARNINGS_AS_ERRORS FALSE)
endif()
if(WARNINGS_AS_ERRORS)
if(CSFML_WARNINGS_AS_ERRORS)
list(APPEND CLANG_AND_GCC_WARNINGS -Werror)
list(APPEND MSVC_WARNINGS /WX)
endif()