diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6614ffe93..19f9cc3ec 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,6 +10,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) if(GLM_TEST_ENABLE_CXX_20) set(CMAKE_CXX_STANDARD 20) add_definitions(-DGLM_FORCE_CXX20) + if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU")) + add_compile_options(-Wc++98-compat) + endif() if(NOT GLM_QUIET) message(STATUS "GLM: Build with C++20 features") endif() @@ -17,6 +20,9 @@ if(GLM_TEST_ENABLE_CXX_20) elseif(GLM_TEST_ENABLE_CXX_17) set(CMAKE_CXX_STANDARD 17) add_definitions(-DGLM_FORCE_CXX17) + if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU")) + add_compile_options(-Wc++98-compat) + endif() if(NOT GLM_QUIET) message(STATUS "GLM: Build with C++17 features") endif() @@ -24,6 +30,9 @@ elseif(GLM_TEST_ENABLE_CXX_17) elseif(GLM_TEST_ENABLE_CXX_14) set(CMAKE_CXX_STANDARD 14) add_definitions(-DGLM_FORCE_CXX14) + if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU")) + add_compile_options(-Wc++98-compat) + endif() if(NOT GLM_QUIET) message(STATUS "GLM: Build with C++14 features") endif() @@ -31,6 +40,9 @@ elseif(GLM_TEST_ENABLE_CXX_14) elseif(GLM_TEST_ENABLE_CXX_11) set(CMAKE_CXX_STANDARD 11) add_definitions(-DGLM_FORCE_CXX11) + if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU")) + add_compile_options(-Wc++98-compat) + endif() if(NOT GLM_QUIET) message(STATUS "GLM: Build with C++11 features") endif()