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()