mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-10-22 17:22:06 +00:00
30 lines
738 B
CMake
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()
|