diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9f2cb74..9c79747 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -15,6 +15,11 @@ endif() option(TURTLE_WERROR "Treat warnings as errors" ON) 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) + 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) target_compile_options(TurtleTestMain INTERFACE -Werror) endif()