From 5ae05c9296f1ca89f6cbd4ee4bb9e3124568c030 Mon Sep 17 00:00:00 2001 From: Christophe Date: Thu, 21 Dec 2023 00:06:02 +0100 Subject: [PATCH] Fix GLM_DISABLE_AUTO_DETECTION error with Werror on Windows --- test/CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ebdaa048..985aa517 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -197,9 +197,11 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") message("GLM: Clang - ${CMAKE_CXX_COMPILER_ID} compiler") endif() - add_compile_options(-Werror -Weverything) + if(NOT GLM_DISABLE_AUTO_DETECTION) + add_compile_options(-Werror -Weverything) + endif() add_compile_options(-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++11-long-long -Wno-padded -Wno-gnu-anonymous-struct -Wno-nested-anon-types) - add_compile_options(-Wno-undefined-reinterpret-cast -Wno-sign-conversion -Wno-unused-variable -Wno-missing-prototypes -Wno-unreachable-code -Wno-missing-variable-declarations -Wno-sign-compare -Wno-global-constructors -Wno-unused-macros -Wno-format-nonliteral -Wno-float-equal) + add_compile_options(-Wno-undefined-reinterpret-cast -Wno-sign-conversion -Wno-unused-variable -Wno-missing-prototypes -Wno-unreachable-code -Wno-missing-variable-declarations -Wno-sign-compare -Wno-global-constructors -Wno-unused-macros -Wno-format-nonliteral -Wno-float-equal) elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") if(NOT GLM_QUIET) @@ -219,7 +221,9 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") message("GLM: Visual C++ - ${CMAKE_CXX_COMPILER_ID} compiler") endif() - add_compile_options(/W4 /WX) + if(NOT GLM_DISABLE_AUTO_DETECTION) + add_compile_options(/W4 /WX) + endif() add_compile_options(/wd4309 /wd4324 /wd4389 /wd4127 /wd4267 /wd4146 /wd4201 /wd4464 /wd4514 /wd4701 /wd4820 /wd4365) add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif()