Add option USE_COTIRE=ON (by default)

Precompiled headers cause rebuild problems with ninja, for example.
This commit is contained in:
Nekotekina 2020-02-10 14:06:23 +03:00
parent 5a41d75eb8
commit 491526b421
3 changed files with 15 additions and 10 deletions

View File

@ -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")

View File

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

View File

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