From aba8096456b3272f9c0fa77cf4cbadfc7a883cbc Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Sun, 18 Apr 2021 00:24:35 -0400
Subject: [PATCH] Fix failure to build objc files due to PCH conflict

---
 indra/llcommon/CMakeLists.txt     |  3 +++
 indra/llfilesystem/CMakeLists.txt |  3 +++
 indra/llwindow/CMakeLists.txt     |  5 +++++
 indra/newview/CMakeLists.txt      | 13 +++++++++++++
 4 files changed, 24 insertions(+)

diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 90a06561a8c..790adedfc68 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -259,6 +259,9 @@ set(llcommon_HEADER_FILES
 if (DARWIN)
   list(APPEND llcommon_HEADER_FILES llsys_objc.h)
   list(APPEND llcommon_SOURCE_FILES llsys_objc.mm)
+
+  set_source_files_properties(llsys_objc.mm
+                              PROPERTIES SKIP_PRECOMPILE_HEADERS TRUE)
 endif (DARWIN)
 
 set_source_files_properties(${llcommon_HEADER_FILES}
diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt
index e6fa0e313e7..18a3beb1278 100644
--- a/indra/llfilesystem/CMakeLists.txt
+++ b/indra/llfilesystem/CMakeLists.txt
@@ -34,6 +34,9 @@ if (DARWIN)
   LIST(APPEND llfilesystem_SOURCE_FILES lldir_utils_objc.h)
   LIST(APPEND llfilesystem_SOURCE_FILES lldir_mac.cpp)
   LIST(APPEND llfilesystem_HEADER_FILES lldir_mac.h)
+
+  set_source_files_properties(lldir_utils_objc.mm
+                            PROPERTIES SKIP_PRECOMPILE_HEADERS TRUE)
 endif (DARWIN)
 
 if (LINUX)
diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt
index 95382d0e9fd..b09dc0cc682 100644
--- a/indra/llwindow/CMakeLists.txt
+++ b/indra/llwindow/CMakeLists.txt
@@ -118,6 +118,11 @@ if (DARWIN)
     llopenglview-objc.h
     llappdelegate-objc.h
     )
+
+    set_source_files_properties(llwindowmacosx-objc.mm
+                                PROPERTIES SKIP_PRECOMPILE_HEADERS TRUE)
+    set_source_files_properties(llopenglview-objc.mm
+                                PROPERTIES SKIP_PRECOMPILE_HEADERS TRUE)
 endif (DARWIN)
 
 
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 2bfcf7f920e..a9468f20892 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1466,6 +1466,7 @@ if (DARWIN)
   set_source_files_properties(
     llappdelegate-objc.mm
     PROPERTIES
+    SKIP_PRECOMPILE_HEADERS TRUE
     COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}"
     # BugsplatMac is a module, imported with @import. That language feature
     # demands these -f switches.
@@ -1476,6 +1477,18 @@ if (DARWIN)
     COMPILE_FLAGS "-fmodules -fcxx-modules -Wno-nullability-completeness"
     )
 
+    set_source_files_properties(
+      llappviewermacosx-objc.mm
+      PROPERTIES 
+      SKIP_PRECOMPILE_HEADERS TRUE
+      )
+
+    set_source_files_properties(
+      llfilepicker_mac.mm
+      PROPERTIES 
+      SKIP_PRECOMPILE_HEADERS TRUE
+      )
+
   find_library(APPKIT_LIBRARY AppKit)
   find_library(COCOA_LIBRARY Cocoa)
   find_library(IOKIT_LIBRARY IOKit)
-- 
GitLab