1
0
Fork 0
forked from lthn/blockchain

Refactor caching logic in CI workflows and update CMake policies for improved build efficiency

This commit is contained in:
snider 2025-10-06 21:15:58 +01:00
parent e51eaf6a05
commit 7f5b4fd6ec
3 changed files with 17 additions and 17 deletions

View file

@ -22,6 +22,7 @@ jobs:
submodules: recursive
- name: Cache SDK Folder
id: cache
uses: actions/cache@v4
with:
path: |
@ -30,11 +31,14 @@ jobs:
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- uses: actions/setup-python@v5
if: steps.cache.outputs.cache-hit != 'true'
with:
python-version: 3.x
- run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- if: steps.cache.outputs.cache-hit != 'true'
run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Compile Release
if: steps.cache.outputs.cache-hit != 'true'
run: make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
msvc-194:

View file

@ -6,20 +6,11 @@ set(DISABLE_TOR TRUE CACHE BOOL "Disable TOR library(and related tor-connect sub
PROJECT(Lethean)
set(VERSION "1.0" CACHE STRING "Build version")
message("OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}")
message("OPENSSL_CRYPTO_LIBRARY: ${OPENSSL_CRYPTO_LIBRARY}")
message("OPENSSL_SSL_LIBRARY: ${OPENSSL_SSL_LIBRARY}")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(DocBuilder)
option (USE_CCACHE "Use ccache if a usable instance is found" ON)
if (USE_CCACHE)
include(FindCcache)
else()
message(STATUS "ccache deselected")
endif()
if(POLICY CMP0043)
cmake_policy(SET CMP0043 NEW)
@ -37,6 +28,14 @@ if(POLICY CMP0167)
cmake_policy(SET CMP0167 OLD)
endif()
include(DocBuilder)
option (USE_CCACHE "Use ccache if a usable instance is found" ON)
if (USE_CCACHE)
include(FindCcache)
else()
message(STATUS "ccache deselected")
endif()
#option (USE_CCACHE "Use ccache if a usable instance is found" ON)
#if (USE_CCACHE)
# include(FindCcache) # Has to be included after the project() macro, to be able to read the CXX variable.
@ -44,8 +43,7 @@ endif()
# message(STATUS "ccache deselected")
#endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "Android")

View file

@ -6,9 +6,7 @@ if (CCACHE_FOUND)
cmake_minimum_required(VERSION 3.10)
project(test)
option (CCACHE "")
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
cmake_policy(SET CMP0091 NEW)
file(WRITE "${CMAKE_SOURCE_DIR}/test.cpp" "int main() { return 0; }")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE} cache_dir=${CMAKE_SOURCE_DIR}/build/.ccache")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE} cache_dir=${CMAKE_SOURCE_DIR}/build/.ccache")