mirror of
https://github.com/likle/cwalk.git
synced 2026-10-28 09:44:01 +00:00
added new build option, IGNORE_WARNINGS
This commit is contained in:
1 parent
d418a2e007
commit
39b5a5d80c
1 file changed
+9
-3
@@ -3,17 +3,23 @@ function(enable_warnings target)
|
||||
if(MSVC)
|
||||
target_compile_definitions(${target} PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||
target_compile_options(${target} PRIVATE /W4)
|
||||
target_compile_options(${target} PRIVATE /WX)
|
||||
if (NOT IGNORE_WARNINGS)
|
||||
target_compile_options(${target} PRIVATE /WX)
|
||||
endif()
|
||||
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
||||
target_compile_options(${target} PRIVATE -Werror)
|
||||
target_compile_options(${target} PRIVATE -Wall)
|
||||
target_compile_options(${target} PRIVATE -Wextra)
|
||||
target_compile_options(${target} PRIVATE -Wpedantic)
|
||||
target_compile_options(${target} PRIVATE -Wno-gnu-zero-variadic-macro-arguments)
|
||||
if (NOT IGNORE_WARNINGS)
|
||||
target_compile_options(${target} PRIVATE -Werror)
|
||||
endif()
|
||||
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
|
||||
target_compile_options(${target} PRIVATE -Wall)
|
||||
target_compile_options(${target} PRIVATE -Werror)
|
||||
target_compile_options(${target} PRIVATE -Wextra)
|
||||
target_compile_options(${target} PRIVATE -Wpedantic)
|
||||
if (NOT IGNORE_WARNINGS)
|
||||
target_compile_options(${target} PRIVATE -Werror)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
Reference in new issue
Block a user