From 9727414e0b51aa4c77a867502b99e11a69536873 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Mon, 3 Apr 2023 17:18:08 -0400
Subject: [PATCH] Further cmake cleanup

---
 indra/CMakeLists.txt                   | 2 ++
 indra/cmake/00-Common.cmake            | 3 ++-
 indra/deps/CMakeLists.txt              | 1 +
 indra/llcommon/CMakeLists.txt          | 2 +-
 indra/media_plugins/cef/CMakeLists.txt | 2 --
 5 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt
index 8b0328b6227..d2a90241c42 100644
--- a/indra/CMakeLists.txt
+++ b/indra/CMakeLists.txt
@@ -11,6 +11,8 @@
 ##   We're not there yet, but once done, there is a kludge in Linking.cmake
 #    "if(${CMAKE_VERSION} VERSION_LESS "3.20.0")" that can also be removed
 cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
+cmake_policy(SET CMP0063 NEW)
+cmake_policy(SET CMP0083 NEW)
 cmake_policy(SET CMP0091 NEW)
 
 set(ROOT_PROJECT_NAME "Alchemy" CACHE STRING
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 3ec6db7e41e..c7c9d56ec07 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -167,6 +167,8 @@ endif (WINDOWS)
 if (LINUX)
   set(CMAKE_SKIP_BUILD_RPATH TRUE)
   set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+  set(CMAKE_C_VISIBILITY_PRESET "hidden")
+  set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
 
   add_compile_definitions(
     LL_LINUX=1
@@ -182,7 +184,6 @@ if (LINUX)
 
   add_compile_options(
     $<$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>:-fstack-protector>
-    -fvisibility=hidden 
     -fexceptions
     -fno-math-errno
     -fno-strict-aliasing
diff --git a/indra/deps/CMakeLists.txt b/indra/deps/CMakeLists.txt
index 174d3596631..83330c68c6f 100644
--- a/indra/deps/CMakeLists.txt
+++ b/indra/deps/CMakeLists.txt
@@ -5,6 +5,7 @@ include(00-Common)
 include(FetchContent)
 
 set(CMAKE_FOLDER "Third Party")
+set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
 set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
 set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
 
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index be3e2e4113b..2c83fac6c62 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -295,7 +295,7 @@ endif()
 
 add_dependencies(llcommon stage_third_party_libs)
 
-if(USE_PRECOMPILED_HEADERS AND ${CMAKE_VERSION} VERSION_GREATER "3.15.0") 
+if(USE_PRECOMPILED_HEADERS) 
   target_precompile_headers(llcommon
     PRIVATE
     linden_common.h
diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt
index 56846c83aa3..57153c1929a 100644
--- a/indra/media_plugins/cef/CMakeLists.txt
+++ b/indra/media_plugins/cef/CMakeLists.txt
@@ -51,8 +51,6 @@ add_library(media_plugin_cef
     ${media_plugin_cef_SOURCE_FILES}
     )
 
-set_target_properties(media_plugin_cef PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
-
 target_link_libraries(media_plugin_cef
         media_plugin_base
         ll::cef
-- 
GitLab