mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-12-16 03:40:57 +01:00
srb2: Simplify cmake patch
This commit is contained in:
parent
7170a915e6
commit
4b63d5b7e5
@ -1,35 +1,11 @@
|
|||||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
index 915912af5..9deb22a2a 100644
|
index 915912af5..f5c2cf9cc 100644
|
||||||
--- a/CMakeLists.txt
|
--- a/CMakeLists.txt
|
||||||
+++ b/CMakeLists.txt
|
+++ b/CMakeLists.txt
|
||||||
@@ -76,26 +76,16 @@ option(SRB2_CONFIG_ZDEBUG "Compile with ZDEBUG defined." OFF)
|
@@ -91,11 +91,6 @@ if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL Windows)
|
||||||
option(SRB2_CONFIG_PROFILEMODE "Compile for profiling (GCC only)." OFF)
|
|
||||||
set(SRB2_CONFIG_ASSET_DIRECTORY "" CACHE PATH "Path to directory that contains all asset files for the installer. If set, assets will be part of installation and cpack.")
|
|
||||||
|
|
||||||
-# Enable CCache
|
|
||||||
-# (Set USE_CCACHE=ON to use, CCACHE_OPTIONS for options)
|
|
||||||
-if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL Windows)
|
|
||||||
- option(USE_CCACHE "Enable ccache support" OFF)
|
|
||||||
-
|
|
||||||
- if(USE_CCACHE)
|
|
||||||
- find_program(CCACHE_TOOL_PATH ccache)
|
|
||||||
- if(CCACHE_TOOL_PATH)
|
|
||||||
- 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()
|
|
||||||
+# Enable CCache early
|
|
||||||
+set(SRB2_USE_CCACHE OFF CACHE BOOL "Use CCache")
|
|
||||||
+if (${SRB2_USE_CCACHE})
|
|
||||||
+ find_program(CCACHE_PROGRAM ccache)
|
|
||||||
+ if(CCACHE_PROGRAM)
|
|
||||||
+ message(STATUS "Found CCache: ${CCACHE_PROGRAM}")
|
|
||||||
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
|
|
||||||
+ else()
|
|
||||||
+ message(WARNING "You have specified to use CCACHE but it was not found. Object files will not be cached.")
|
|
||||||
endif()
|
endif()
|
||||||
-else()
|
endif()
|
||||||
|
else()
|
||||||
- CPMAddPackage(
|
- CPMAddPackage(
|
||||||
- NAME Ccache.cmake
|
- NAME Ccache.cmake
|
||||||
- GITHUB_REPOSITORY TheLartians/Ccache.cmake
|
- GITHUB_REPOSITORY TheLartians/Ccache.cmake
|
||||||
@ -38,24 +14,6 @@ index 915912af5..9deb22a2a 100644
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
diff --git a/cmake/launch-c.in b/cmake/launch-c.in
|
|
||||||
new file mode 100644
|
|
||||||
index 000000000..c60558232
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/cmake/launch-c.in
|
|
||||||
@@ -0,0 +1,3 @@
|
|
||||||
+#!/bin/sh
|
|
||||||
+export CCACHE_CPP2=true
|
|
||||||
+exec "${RULE_LAUNCH_COMPILE}" "${CMAKE_C_COMPILER}" "$@"
|
|
||||||
diff --git a/cmake/launch-cxx.in b/cmake/launch-cxx.in
|
|
||||||
new file mode 100644
|
|
||||||
index 000000000..c60558232
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/cmake/launch-cxx.in
|
|
||||||
@@ -0,0 +1,3 @@
|
|
||||||
+#!/bin/sh
|
|
||||||
+export CCACHE_CPP2=true
|
|
||||||
+exec "${RULE_LAUNCH_COMPILE}" "${CMAKE_C_COMPILER}" "$@"
|
|
||||||
--
|
--
|
||||||
2.40.1
|
2.40.1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user