LCE-Emerald-Launcher/cmake/CompilerWarnings.cmake
2026-10-19 23:49:11 +03:00

30 lines
738 B
CMake

function(emerald_apply_warnings target)
if(MSVC)
target_compile_options(${target} PRIVATE /W4 /permissive-)
if(EMERALD_WARNINGS_AS_ERRORS)
target_compile_options(${target} PRIVATE /WX)
endif()
return()
endif()
target_compile_options(${target} PRIVATE
-Wall
-Wextra
-Wpedantic
-Wshadow
-Wconversion
-Wsign-conversion
-Wnon-virtual-dtor
-Wold-style-cast
-Wcast-align
-Wunused
-Woverloaded-virtual
-Wnull-dereference
-Wdouble-promotion
-Wformat=2
)
if(EMERALD_WARNINGS_AS_ERRORS)
target_compile_options(${target} PRIVATE -Werror)
endif()
endfunction()