sccache is autodetected now - optional in presets

This commit is contained in:
Kae 2024-03-09 09:49:00 +11:00
parent 7b556b33f8
commit 4c2e75b585
2 changed files with 13 additions and 9 deletions

View File

@ -1,14 +1,19 @@
cmake_minimum_required(VERSION 3.23) cmake_minimum_required(VERSION 3.23)
# Find CCache # Find SCCache or CCache
if (NOT CMAKE_CXX_COMPILER_LAUNCHER MATCHES "ccache") if (NOT CMAKE_CXX_COMPILER_LAUNCHER MATCHES "ccache")
find_program(CCACHE_PATH ccache) find_program(SCCACHE_PATH sccache)
if(CCACHE_PATH) if(SCCACHE_PATH)
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PATH}") message(STATUS "Using SCCache at ${SCCACHE_PATH}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PATH}") set(CMAKE_C_COMPILER_LAUNCHER ${SCCACHE_PATH})
message(STATUS "Using CCache") set(CMAKE_CXX_COMPILER_LAUNCHER ${SCCACHE_PATH})
else() 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()
endif() endif()
@ -18,6 +23,7 @@ if(CMAKE_CXX_COMPILER_LAUNCHER MATCHES "ccache")
else() else()
set(STAR_CCACHE FALSE) set(STAR_CCACHE FALSE)
set(STAR_PRECOMPILED_HEADERS TRUE) set(STAR_PRECOMPILED_HEADERS TRUE)
message(STATUS "Not using CCache")
endif() endif()
project(starbound) project(starbound)

View File

@ -16,8 +16,6 @@
"CMAKE_INSTALL_PREFIX": "${sourceParentDir}/install", "CMAKE_INSTALL_PREFIX": "${sourceParentDir}/install",
"VCPKG_OVERLAY_TRIPLETS": "${sourceParentDir}/triplets", "VCPKG_OVERLAY_TRIPLETS": "${sourceParentDir}/triplets",
"CMAKE_VERBOSE_MAKEFILE": true, "CMAKE_VERBOSE_MAKEFILE": true,
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
"BUILD_TESTING": true, "BUILD_TESTING": true,
"STAR_ENABLE_STEAM_INTEGRATION": true, "STAR_ENABLE_STEAM_INTEGRATION": true,
"STAR_ENABLE_DISCORD_INTEGRATION": true "STAR_ENABLE_DISCORD_INTEGRATION": true