From 491526b42185c864883176f5000e144b9ac3c83e Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Mon, 10 Feb 2020 14:06:23 +0300 Subject: [PATCH] Add option USE_COTIRE=ON (by default) Precompiled headers cause rebuild problems with ninja, for example. --- CMakeLists.txt | 1 + rpcs3/CMakeLists.txt | 10 ++++++---- rpcs3/Emu/CMakeLists.txt | 14 ++++++++------ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45c183c157..be5012a878 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ option(USE_LIBEVDEV "libevdev-based joystick support" ON) option(USE_DISCORD_RPC "Discord rich presence integration" ON) option(USE_SYSTEM_ZLIB "Prefer system ZLIB instead of the builtin one" ON) option(USE_VULKAN "Vulkan render backend" ON) +option(USE_COTIRE "Use precompiled headers" ON) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/rpcs3/cmake_modules") diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index eb8787957b..55b5d92518 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -110,11 +110,13 @@ else() target_link_libraries(rpcs3 ${CMAKE_DL_LIBS}) endif() -set_target_properties(rpcs3 PROPERTIES - COTIRE_CXX_PREFIX_HEADER_INIT "${RPCS3_SRC_DIR}/stdafx.h" - COTIRE_ADD_UNITY_BUILD OFF) +if(USE_COTIRE) + set_target_properties(rpcs3 PROPERTIES + COTIRE_CXX_PREFIX_HEADER_INIT "${RPCS3_SRC_DIR}/stdafx.h" + COTIRE_ADD_UNITY_BUILD OFF) -cotire(rpcs3) + cotire(rpcs3) +endif() # Copy icons to executable directory if(APPLE) diff --git a/rpcs3/Emu/CMakeLists.txt b/rpcs3/Emu/CMakeLists.txt index bb4e49ae5a..79dd04e0ba 100644 --- a/rpcs3/Emu/CMakeLists.txt +++ b/rpcs3/Emu/CMakeLists.txt @@ -431,11 +431,13 @@ target_link_libraries(rpcs3_emu ) -# Setup cotire -option(UNITY_BUILD_EMU "Use unity build for rpcs3_emu target" OFF) +if (USE_COTIRE) + # Setup cotire + option(UNITY_BUILD_EMU "Use unity build for rpcs3_emu target" OFF) -set_target_properties(rpcs3_emu PROPERTIES - COTIRE_CXX_PREFIX_HEADER_INIT "${RPCS3_SRC_DIR}/stdafx.h" - COTIRE_ADD_UNITY_BUILD ${UNITY_BUILD_EMU}) + set_target_properties(rpcs3_emu PROPERTIES + COTIRE_CXX_PREFIX_HEADER_INIT "${RPCS3_SRC_DIR}/stdafx.h" + COTIRE_ADD_UNITY_BUILD ${UNITY_BUILD_EMU}) -cotire(rpcs3_emu) + cotire(rpcs3_emu) +endif()