Files
pokemon-battle-engine/cmake/modules/CompilerWarnings.cmake
cdemeyer-teachx 1c1e7f8d51 Google Tests
2025-08-14 10:19:03 +09:00

23 lines
544 B
CMake

# Compiler warnings configuration
function(set_project_warnings)
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" ON)
if(MSVC)
add_compile_options(
/W4
/permissive-
$<$<BOOL:${WARNINGS_AS_ERRORS}>:/WX>
)
else()
add_compile_options(
-Wall
-Wextra
-Wpedantic
-Wshadow
-Wconversion
-Wsign-conversion
$<$<BOOL:${WARNINGS_AS_ERRORS}>:-Werror>
)
endif()
endfunction()