mirror of
https://github.com/threeal/cmake-action.git
synced 2025-06-08 18:21:20 +00:00
guard CMake warning if CHECK_SURPASS_WARNING
is set
This commit is contained in:
parent
08b5e950b4
commit
699bfa804e
@ -4,8 +4,10 @@ project(test)
|
|||||||
option(CHECK_USING_CLANG "check if target is compiled using Clang" OFF)
|
option(CHECK_USING_CLANG "check if target is compiled using Clang" OFF)
|
||||||
option(CHECK_SURPASS_WARNING "check if target could surpass a compiler warning" OFF)
|
option(CHECK_SURPASS_WARNING "check if target could surpass a compiler warning" OFF)
|
||||||
|
|
||||||
|
if(CHECK_SURPASS_WARNING)
|
||||||
set(CMAKE_C_FLAGS "-Werror -Wunused-variable ${CMAKE_C_FLAGS}")
|
set(CMAKE_C_FLAGS "-Werror -Wunused-variable ${CMAKE_C_FLAGS}")
|
||||||
set(CMAKE_CXX_FLAGS "-Werror -Wunused-variable ${CMAKE_CXX_FLAGS}")
|
set(CMAKE_CXX_FLAGS "-Werror -Wunused-variable ${CMAKE_CXX_FLAGS}")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable(hello_world hello_world.cpp)
|
add_executable(hello_world hello_world.cpp)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user