mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
cmake: Use TheLartians' Ccache script on non-Win32
Improves ccache support for Xcode
This commit is contained in:
parent
04674ca93b
commit
f0338d22d7
3 changed files with 19 additions and 15 deletions
|
|
@ -69,16 +69,26 @@ cmake_dependent_option(
|
||||||
option(SRB2_CONFIG_HWRENDER "Enable hardware render (OpenGL) support" ON)
|
option(SRB2_CONFIG_HWRENDER "Enable hardware render (OpenGL) support" ON)
|
||||||
option(SRB2_CONFIG_STATIC_OPENGL "Enable static linking GL (do not do this)" OFF)
|
option(SRB2_CONFIG_STATIC_OPENGL "Enable static linking GL (do not do this)" OFF)
|
||||||
|
|
||||||
# Enable CCache early
|
# Enable CCache
|
||||||
set(SRB2_USE_CCACHE OFF CACHE BOOL "Use CCache")
|
# (Set USE_CCACHE=ON to use, CCACHE_OPTIONS for options)
|
||||||
if (${SRB2_USE_CCACHE})
|
if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL Windows)
|
||||||
find_program(CCACHE_PROGRAM ccache)
|
option(USE_CCACHE "Enable ccache support" OFF)
|
||||||
if(CCACHE_PROGRAM)
|
|
||||||
message(STATUS "Found CCache: ${CCACHE_PROGRAM}")
|
if(USE_CCACHE)
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
|
find_program(CCACHE_TOOL_PATH ccache)
|
||||||
else()
|
if(CCACHE_TOOL_PATH)
|
||||||
message(WARNING "You have specified to use CCACHE but it was not found. Object files will not be cached.")
|
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_TOOL_PATH} CACHE STRING "" FORCE)
|
||||||
|
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_TOOL_PATH} CACHE STRING "" FORCE)
|
||||||
|
else()
|
||||||
|
message(WARNING "USE_CCACHE was set but ccache is not found (set CCACHE_TOOL_PATH)")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
CPMAddPackage(
|
||||||
|
NAME Ccache.cmake
|
||||||
|
GITHUB_REPOSITORY TheLartians/Ccache.cmake
|
||||||
|
VERSION 1.2
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
export CCACHE_CPP2=true
|
|
||||||
exec "${RULE_LAUNCH_COMPILE}" "${CMAKE_C_COMPILER}" "$@"
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
export CCACHE_CPP2=true
|
|
||||||
exec "${RULE_LAUNCH_COMPILE}" "${CMAKE_C_COMPILER}" "$@"
|
|
||||||
Loading…
Add table
Reference in a new issue