From 4b63d5b7e5089677bf81c911f8d628411d198918 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Tue, 23 May 2023 08:44:46 -0400 Subject: [PATCH] srb2: Simplify cmake patch --- games/srb2/package/cmake.patch | 50 +++------------------------------- 1 file changed, 4 insertions(+), 46 deletions(-) diff --git a/games/srb2/package/cmake.patch b/games/srb2/package/cmake.patch index 71784101..adb070a1 100644 --- a/games/srb2/package/cmake.patch +++ b/games/srb2/package/cmake.patch @@ -1,35 +1,11 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 915912af5..9deb22a2a 100644 +index 915912af5..f5c2cf9cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -76,26 +76,16 @@ option(SRB2_CONFIG_ZDEBUG "Compile with ZDEBUG defined." OFF) - 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.") +@@ -91,11 +91,6 @@ if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL Windows) + endif() endif() --else() + else() - CPMAddPackage( - NAME Ccache.cmake - GITHUB_REPOSITORY TheLartians/Ccache.cmake @@ -38,24 +14,6 @@ index 915912af5..9deb22a2a 100644 endif() # 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