From 9dd79d002848912da3a737624e679040c619bf39 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Thu, 1 Oct 2020 06:56:53 -0400
Subject: [PATCH] Fix unknown pragma spam on gcc 8

---
 indra/cmake/00-Common.cmake | 7 ++++++-
 indra/llcommon/llstring.h   | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index ddb03441881..6fb6f819fef 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -299,11 +299,16 @@ if (LINUX OR DARWIN)
   endif (CMAKE_CXX_COMPILER MATCHES ".*clang")
 
   if (CMAKE_COMPILER_IS_GNUCXX)
-    set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-deprecated-copy -Wno-ignored-qualifiers -Wno-unused-function -Wnon-virtual-dtor")
+    set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-ignored-qualifiers -Wno-unused-function -Wnon-virtual-dtor")
   elseif (CMAKE_COMPILER_IS_CLANGXX)
     set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
   endif()
 
+  CHECK_CXX_COMPILER_FLAG(-Wdeprecated-copy HAS_DEPRECATED_COPY)
+  if (HAS_DEPRECATED_COPY)
+    set(GCC_WARNINGS "${GCC_WARNINGS} -Wno-deprecated-copy")
+  endif()
+
   if (NOT GCC_DISABLE_FATAL_WARNINGS)
   #  set(GCC_WARNINGS "${GCC_WARNINGS} -Werror")
   endif (NOT GCC_DISABLE_FATAL_WARNINGS)
diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h
index 1559ec15003..7571af1adb4 100644
--- a/indra/llcommon/llstring.h
+++ b/indra/llcommon/llstring.h
@@ -27,7 +27,7 @@
 #ifndef LL_LLSTRING_H
 #define LL_LLSTRING_H
 
-#if LL_GNUC
+#if LL_GNUC && GCC_VERSION >= 90000
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor"
 #endif
-- 
GitLab