Disable -Wunused-function for tests

This commit is contained in:
Alexander Grund 2020-04-17 22:01:15 +02:00 committed by Alexander Grund
parent 87e4326883
commit 70ae7674e5
No known key found for this signature in database
GPG key ID: AA48A0760367A42B

View file

@ -15,6 +15,11 @@ endif()
option(TURTLE_WERROR "Treat warnings as errors" ON) option(TURTLE_WERROR "Treat warnings as errors" ON)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(TurtleTestMain INTERFACE -Wall -Wextra -pedantic -Wno-long-long) target_compile_options(TurtleTestMain INTERFACE -Wall -Wextra -pedantic -Wno-long-long)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-Wunused-function TURTLE_CXX_UNUSED_FUNCTION)
if(TURTLE_CXX_UNUSED_FUNCTION)
target_compile_options(TurtleTestMain INTERFACE -Wno-unused-function)
endif()
if(TURTLE_WERROR) if(TURTLE_WERROR)
target_compile_options(TurtleTestMain INTERFACE -Werror) target_compile_options(TurtleTestMain INTERFACE -Werror)
endif() endif()