Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/CMakeLists.txt20
-rw-r--r--source/CMakePresets.json2
2 files changed, 13 insertions, 9 deletions
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index 770c82e..6ed5bb5 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -1,14 +1,19 @@
cmake_minimum_required(VERSION 3.23)
-# Find CCache
+# Find SCCache or CCache
if (NOT CMAKE_CXX_COMPILER_LAUNCHER MATCHES "ccache")
- find_program(CCACHE_PATH ccache)
- if(CCACHE_PATH)
- set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PATH}")
- set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PATH}")
- message(STATUS "Using CCache")
+ find_program(SCCACHE_PATH sccache)
+ if(SCCACHE_PATH)
+ message(STATUS "Using SCCache at ${SCCACHE_PATH}")
+ set(CMAKE_C_COMPILER_LAUNCHER ${SCCACHE_PATH})
+ set(CMAKE_CXX_COMPILER_LAUNCHER ${SCCACHE_PATH})
else()
- message(STATUS "Not using CCache")
+ find_program(CCACHE_PATH ccache)
+ if(CCACHE_PATH)
+ set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PATH}")
+ set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PATH}")
+ message(STATUS "Using CCache")
+ endif()
endif()
endif()
@@ -18,6 +23,7 @@ if(CMAKE_CXX_COMPILER_LAUNCHER MATCHES "ccache")
else()
set(STAR_CCACHE FALSE)
set(STAR_PRECOMPILED_HEADERS TRUE)
+ message(STATUS "Not using CCache")
endif()
project(starbound)
diff --git a/source/CMakePresets.json b/source/CMakePresets.json
index 13a65c7..8bdbeea 100644
--- a/source/CMakePresets.json
+++ b/source/CMakePresets.json
@@ -16,8 +16,6 @@
"CMAKE_INSTALL_PREFIX": "${sourceParentDir}/install",
"VCPKG_OVERLAY_TRIPLETS": "${sourceParentDir}/triplets",
"CMAKE_VERBOSE_MAKEFILE": true,
- "CMAKE_C_COMPILER_LAUNCHER": "sccache",
- "CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
"BUILD_TESTING": true,
"STAR_ENABLE_STEAM_INTEGRATION": true,
"STAR_ENABLE_DISCORD_INTEGRATION": true