From 221e425fe664a6981b3b37ee8a303d0b9c1ac354 Mon Sep 17 00:00:00 2001
From: AnyOldName3 <krizdjali+gitlab@gmail.com>
Date: Thu, 9 Dec 2021 14:59:17 +0000
Subject: [PATCH] Only precompile headers with MSVC

---
 apps/openmw/CMakeLists.txt | 2 +-
 components/CMakeLists.txt  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt
index 94babb6ab1..b54ecb416c 100644
--- a/apps/openmw/CMakeLists.txt
+++ b/apps/openmw/CMakeLists.txt
@@ -155,7 +155,7 @@ target_link_libraries(openmw
     components
 )
 
-if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16)
+if (MSVC AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.16)
     target_precompile_headers(openmw PRIVATE ${SOL_INCLUDE_DIR}/sol/sol.hpp)
 endif ()
 
diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt
index cea215fe42..e980eb5532 100644
--- a/components/CMakeLists.txt
+++ b/components/CMakeLists.txt
@@ -373,6 +373,6 @@ if(USE_QT)
     set_property(TARGET components_qt PROPERTY AUTOMOC ON)
 endif(USE_QT)
 
-if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16)
+if (MSVC AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.16)
     target_precompile_headers(components PRIVATE ${SOL_INCLUDE_DIR}/sol/sol.hpp)
 endif ()