Maintenance #12
@@ -6,6 +6,13 @@ on:
|
||||
- '**'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
CCACHE_DIR: /ccache
|
||||
CCACHE_MAXSIZE: 10G
|
||||
CCACHE_BASEDIR: /root/.conan2
|
||||
CCACHE_NOHASHDIR: "true"
|
||||
CCACHE_COMPILERCHECK: "%compiler% -dumpversion"
|
||||
|
||||
jobs:
|
||||
conan-packages-tier1:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
30
ConanProfiles/Toolchains/ccache.cmake
Normal file
30
ConanProfiles/Toolchains/ccache.cmake
Normal file
@@ -0,0 +1,30 @@
|
||||
include_guard()
|
||||
|
||||
# Find ccache executable
|
||||
find_program(CCACHE_PROGRAM NAMES ccache)
|
||||
|
||||
if(CCACHE_PROGRAM)
|
||||
message(STATUS "ccache found: ${CCACHE_PROGRAM}, enabling via CMake launcher and environment.")
|
||||
if (CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
# Copy original ccache.exe and rename to cl.exe, this way intermediate cmd file is not needed
|
||||
file(COPY_FILE ${CCACHE_PROGRAM} ${CMAKE_BINARY_DIR}/cl.exe ONLY_IF_DIFFERENT)
|
||||
|
||||
# Set Visual Studio global variables:
|
||||
# - Use above cl.exe (ccache.exe) as a compiler
|
||||
# - Enable parallel compilation
|
||||
list(APPEND CMAKE_VS_GLOBALS
|
||||
"CLToolExe=cl.exe"
|
||||
"CLToolPath=${CMAKE_BINARY_DIR}"
|
||||
"UseMultiToolTask=true"
|
||||
"UseStructuredOutput=false"
|
||||
)
|
||||
elseif(CMAKE_GENERATOR MATCHES "Ninja" OR CMAKE_GENERATOR MATCHES "Unix Makefiles")
|
||||
message(STATUS "Using ccache as compiler launcher for Ninja or Makefiles.")
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM} CACHE FILEPATH "CXX compiler cache used" FORCE)
|
||||
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_PROGRAM} CACHE FILEPATH "C compiler cache used" FORCE)
|
||||
else()
|
||||
message(WARNING "Unsupported generator for ccache integration: ${CMAKE_GENERATOR}. ccache will not be used.")
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "ccache not found. Not enabling ccache integration.")
|
||||
endif()
|
||||
@@ -10,6 +10,8 @@ compiler.runtime=static
|
||||
build_type=Release
|
||||
|
||||
[conf]
|
||||
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ccache.cmake
|
||||
|
||||
tools.system.package_manager:mode=install
|
||||
tools.system.package_manager:sudo=True
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ compiler.runtime=static
|
||||
build_type=Release
|
||||
|
||||
[conf]
|
||||
tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ccache.cmake
|
||||
|
||||
tools.build:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/D_CRT_DECLARE_NONSTDC_NAMES=1"]
|
||||
tools.build:cxxflags=["/Zc:preprocessor", "/permissive-", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user