Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Add support for clcache on Windows

Tact Yoshidaaadc03a56a77
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 83683c99b..e53bd0ead 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -84,6 +84,7 @@ jobs:
runs-on: windows-2019
env:
vcpkg_ref: d989ad416b923a9f895c4bddc446d1ef370a3af8
+ CLCACHE_CL: 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl_original.exe'
steps:
- uses: actions/checkout@v2
@@ -123,6 +124,19 @@ jobs:
vcpkg install --clean-after-build --triplet x64-windows freeglut glew
vcpkg install --clean-after-build --triplet x64-windows qt5-base qt5-multimedia qt5-script qt5-svg qt5-tools
+ - name: Install clcache
+ run: |
+ pip install clcache
+ Rename-Item -Path 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe' -NewName 'cl_original.exe'
+ Rename-Item -Path 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe.config' -NewName 'cl_original.exe.config'
+ cp 'C:/hostedtoolcache/windows/Python/3.6.8/x64/Scripts/clcache.exe' 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe'
+
+ - uses: actions/cache@v1
+ with:
+ path: C:/Users/runneradmin/clcache
+ key: ${{ runner.os }}-clcache-${{ github.sha }}
+ restore-keys: ${{ runner.os }}-clcache-
+
- name: Build libtiff
run: |
cd thirdparty/tiff-4.0.3
@@ -130,6 +144,7 @@ jobs:
cp libtiff/tiffconf.vc.h libtiff/tiffconf.h
cd prj/LibTIFF
$env:Path += ';C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/Bin'
+ $env:CLCACHE_CL = '${{ env.CLCACHE_CL }}'
msbuild LibTIFF.vcxproj /p:PlatformToolset=v142 /p:Platform=x64 /p:Configuration=Release -maxcpucount:3
- name: Build mypaint/libmypaint
@@ -138,8 +153,9 @@ jobs:
cp ../.github/workflows/CMakeLists.txt .
echo '#define MYPAINT_CONFIG_USE_GLIB 0' > config.h
python generate.py mypaint-brush-settings-gen.h brushsettings-gen.h
- mkdir build
+ mkdir build | Out-Null
cd build
+ $env:CLCACHE_CL = '${{ env.CLCACHE_CL }}'
cmake ../ -G 'Visual Studio 16 2019' -Ax64 -Djson-c_DIR='C:/vcpkg/installed/x64-windows-static/share/json-c/' -DJSON-C_INCLUDE_DIR='C:/vcpkg/installed/x64-windows-static/include/json-c/'
cmake --build . --config Release
cp C:/vcpkg/installed/x64-windows-static/lib/json-c.lib .
@@ -150,8 +166,9 @@ jobs:
- name: Build xiaoyeli/superlu
run: |
cd superlu
- mkdir build
+ mkdir build | Out-Null
cd build
+ $env:CLCACHE_CL = '${{ env.CLCACHE_CL }}'
cmake ../ -G 'Visual Studio 16 2019' -Ax64 -DXSDK_ENABLE_Fortran=OFF -Denable_tests=OFF
cmake --build . --config Release
@@ -179,14 +196,15 @@ jobs:
- name: Build
run: |
cd toonz
- mkdir build
+ mkdir build | Out-Null
cd build
+ $env:CLCACHE_CL = '${{ env.CLCACHE_CL }}'
cmake ../sources -G 'Visual Studio 16 2019' -Ax64 -DQT_PATH='C:/vcpkg/installed/x64-windows/bin' -DQt5_DIR='C:/vcpkg/installed/x64-windows/share/cmake/Qt5' -DBOOST_ROOT="$env:BOOST_ROOT_1_69_0"
cmake --build . --config Release
- name: Create Artifact
run: |
- mkdir artifact
+ mkdir artifact | Out-Null
cd artifact
cp -Recurse ../stuff portablestuff
cp ../toonz/build/Release/* .