Use sccache more effectively in windows builds

This commit is contained in:
sentientstardust
2026-05-20 03:14:54 +01:00
parent 29be1d396e
commit 6646aba3cf
2 changed files with 12 additions and 6 deletions

View File

@@ -364,7 +364,7 @@ jobs:
# env:
# WindowsSdkDir: 'C:\Program Files (x86)\Windows Kits\10\'
# WindowsSDKVersion: '10.0.26100.0\'
run: .\build_release_vs.bat slicer ${{ !vars.SELF_HOSTED && '-x' || '' }}
run: .\build_release_vs.bat slicer ${{ !vars.SELF_HOSTED && '-x -p' || '' }}
- name: Show sccache stats Windows
if: ${{ always() && runner.os == 'Windows' && !vars.SELF_HOSTED }}

View File

@@ -9,6 +9,11 @@ for %%a in (%*) do (
if "%%a"=="-x" set USE_NINJA=1
)
set "SLIC3R_PRECOMPILED_HEADERS="
for %%a in (%*) do (
if "%%a"=="-p" set SLIC3R_PRECOMPILED_HEADERS=OFF
)
if "%USE_NINJA%"=="1" (
echo Using Ninja Multi-Config generator
set CMAKE_GENERATOR="Ninja Multi-Config"
@@ -135,16 +140,17 @@ cd %build_dir%
echo on
set CMAKE_POLICY_VERSION_MINIMUM=3.5
set "CMAKE_LAUNCHER_FLAGS="
if defined CMAKE_C_COMPILER_LAUNCHER set "CMAKE_LAUNCHER_FLAGS=%CMAKE_LAUNCHER_FLAGS% -DCMAKE_C_COMPILER_LAUNCHER=%CMAKE_C_COMPILER_LAUNCHER%"
if defined CMAKE_CXX_COMPILER_LAUNCHER set "CMAKE_LAUNCHER_FLAGS=%CMAKE_LAUNCHER_FLAGS% -DCMAKE_CXX_COMPILER_LAUNCHER=%CMAKE_CXX_COMPILER_LAUNCHER%"
set "CMAKE_CONFIGURE_FLAGS="
if defined CMAKE_C_COMPILER_LAUNCHER set "CMAKE_CONFIGURE_FLAGS=%CMAKE_CONFIGURE_FLAGS% -DCMAKE_C_COMPILER_LAUNCHER=%CMAKE_C_COMPILER_LAUNCHER%"
if defined CMAKE_CXX_COMPILER_LAUNCHER set "CMAKE_CONFIGURE_FLAGS=%CMAKE_CONFIGURE_FLAGS% -DCMAKE_CXX_COMPILER_LAUNCHER=%CMAKE_CXX_COMPILER_LAUNCHER%"
if defined SLIC3R_PRECOMPILED_HEADERS set "CMAKE_CONFIGURE_FLAGS=%CMAKE_CONFIGURE_FLAGS% -DSLIC3R_PCH=%SLIC3R_PRECOMPILED_HEADERS%"
if "%USE_NINJA%"=="1" (
cmake .. -G %CMAKE_GENERATOR% -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type% %CMAKE_LAUNCHER_FLAGS%
cmake .. -G %CMAKE_GENERATOR% -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type% %CMAKE_CONFIGURE_FLAGS%
if errorlevel 1 exit /b 1
cmake --build . --config %build_type%
if errorlevel 1 exit /b 1
) else (
cmake .. -G %CMAKE_GENERATOR% -A x64 -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type% %CMAKE_LAUNCHER_FLAGS%
cmake .. -G %CMAKE_GENERATOR% -A x64 -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type% %CMAKE_CONFIGURE_FLAGS%
if errorlevel 1 exit /b 1
cmake --build . --config %build_type% --target ALL_BUILD -- -m
if errorlevel 1 exit /b 1