From afd0eb0a259d42d1eda1939e8a854595ccca2427 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Mon, 5 Apr 2021 15:10:35 -0400
Subject: [PATCH] Start dropping in broader PCH usage with modern cmake

---
 indra/llcommon/CMakeLists.txt   | 19 +++++++++++++++++++
 indra/llcorehttp/CMakeLists.txt | 18 ++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 42b5f4bd9d0..d9e076bc127 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -303,6 +303,25 @@ target_link_libraries(
 
 add_dependencies(llcommon stage_third_party_libs)
 
+if(${CMAKE_VERSION} VERSION_GREATER "3.15.0") 
+  target_precompile_headers(llcommon
+    PUBLIC
+    linden_common.h
+    llwin32headerslean.h
+    PRIVATE
+    <algorithm>
+    <atomic>
+    <functional>
+    <map>
+    <mutex>
+    <string>
+    <string_view>
+    <thread>
+    <absl/container/node_hash_map.h>
+    <absl/container/flat_hash_map.h>
+    )
+endif()
+
 if (LL_TESTS)
   include(LLAddBuildTest)
   SET(llcommon_TEST_SOURCE_FILES
diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt
index 646ba2f72c7..11dac33e534 100644
--- a/indra/llcorehttp/CMakeLists.txt
+++ b/indra/llcorehttp/CMakeLists.txt
@@ -102,6 +102,24 @@ target_link_libraries(
   ${BOOST_SYSTEM_LIBRARY}
   )
 
+if(${CMAKE_VERSION} VERSION_GREATER "3.15.0") 
+  target_precompile_headers(llcorehttp
+    PUBLIC
+  [["linden_common.h"]]
+  [["llsd.h"]]
+  PRIVATE
+  <boost/intrusive_ptr.hpp>
+  <boost/shared_ptr.hpp>
+  <boost/make_shared.hpp>
+  <boost/weak_ptr.hpp>
+  <boost/function.hpp>
+  <boost/noncopyable.hpp>
+  <string>
+  <curl/curl.h>
+  )
+endif()
+
+
 # tests
 set(LLCOREHTTP_TESTS ON CACHE BOOL
     "Build and run llcorehttp integration tests specifically")
-- 
GitLab