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 ()