From d01e81f4d122a1f8942f1b296b5d3a4d1cc22ec3 Mon Sep 17 00:00:00 2001
From: Nicky <nicky.dasmijn@gmail.com>
Date: Sat, 9 Apr 2022 23:40:22 +0200
Subject: [PATCH] Fix warning supression for Linux/OSX, this was broken after
 the first round of cmake changes on Windows.
 -Wno-unused-but-set-variable/-Wno-unused-variable moved from just Linux to
 also OSX (clang) as there's a lot of those in the code where newer xcode
 complains. Fixing all those places is going beyond the scope of modernizing
 cmake.

---
 indra/cmake/00-Common.cmake | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 4f0a6063db5..d203d435459 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -132,8 +132,6 @@ if (LINUX)
           -pthread
           -Wno-parentheses
           -Wno-deprecated
-          -Wno-unused-but-set-variable
-          -Wno-unused-variable
           -fvisibility=hidden
   )
 
@@ -183,19 +181,15 @@ if (LINUX OR DARWIN)
     set(CMAKE_COMPILER_IS_CLANGXX 1)
   endif (CMAKE_CXX_COMPILER MATCHES ".*clang")
 
-  if (CMAKE_COMPILER_IS_GNUCXX)
-    set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
-  elseif (CMAKE_COMPILER_IS_CLANGXX)
-    set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
-  endif()
+  set(GCC_WARNINGS -Wall -Wno-sign-compare -Wno-trigraphs)
 
   if (NOT GCC_DISABLE_FATAL_WARNINGS)
-    set(GCC_WARNINGS "${GCC_WARNINGS} -Werror")
+    list(APPEND GCC_WARNINGS -Werror)
   endif (NOT GCC_DISABLE_FATAL_WARNINGS)
 
-  set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor")
+  list(APPEND GCC_WARNINGS -Wno-reorder -Wno-non-virtual-dtor -Wno-unused-but-set-variable  -Wno-unused-variable )
 
-  add_compile_options(${GCC_CXX_WARNINGS})
+  add_compile_options(${GCC_WARNINGS})
   add_compile_options(-m${ADDRESS_SIZE})
 endif (LINUX OR DARWIN)
 
-- 
GitLab