Fix sccache

This commit is contained in:
momo5502
2025-05-29 09:58:51 +02:00
parent 5041bab9f8
commit 5022e3049a
3 changed files with 14 additions and 13 deletions

View File

@@ -52,6 +52,14 @@ jobs:
sudo update-alternatives --set cc /usr/bin/clang-${{ env.LLVM_VERSION }}
sudo update-alternatives --set c++ /usr/bin/clang++-${{ env.LLVM_VERSION }}
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.8
- name: Setup Environment Variables
shell: bash
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
- name: CMake Build
run: cmake --preset=release -DMOMO_ENABLE_CLANG_TIDY=On && cmake --build --preset=release

View File

@@ -203,8 +203,8 @@ set(OPT_DEBUG "-O0 -g")
set(OPT_RELEASE "-O3 -g")
if(MSVC)
set(OPT_DEBUG "/Od /Ob0 /Zi")
set(OPT_RELEASE "/O2 /Ob2 /Zi")
set(OPT_DEBUG "/Od /Ob0 /Z7")
set(OPT_RELEASE "/O2 /Ob2 /Z7")
add_link_options(/DEBUG)
endif()

View File

@@ -1,15 +1,8 @@
include_guard()
if(CMAKE_GENERATOR STREQUAL "Ninja")
find_program(SCCACHE sccache REQUIRED)
find_program(SCCACHE sccache)
if (SCCACHE)
set(CMAKE_C_COMPILER_LAUNCHER ${SCCACHE})
set(CMAKE_CXX_COMPILER_LAUNCHER ${SCCACHE})
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded)
if(POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
endif()
endif()
if (SCCACHE)
set(CMAKE_C_COMPILER_LAUNCHER ${SCCACHE})
set(CMAKE_CXX_COMPILER_LAUNCHER ${SCCACHE})
endif()