Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ccache to speed up build #695

Closed
15 changes: 11 additions & 4 deletions .github/workflows/build-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:

matrix:
os: [ubuntu-22.04, ubuntu-20.04, windows-latest, windows-2019, macos-latest, macos-11]
build_type: [Release]
include:
- os: windows-latest
cmake_options: -DWITH_DRIVER_DIRECT3D=ON -DWITH_DRIVER_XAUDIO2=ON
Expand All @@ -40,6 +41,10 @@ jobs:
echo "hunter-dir=${{ github.workspace }}/.hunter" >> "$GITHUB_OUTPUT"
echo "cmake-version=3.27.9" >> "$GITHUB_OUTPUT"
echo "cmake-install-dir=/opt/cmake-3.27.9" >> "$GITHUB_OUTPUT"
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os }}-${{ matrix.build_type }}

- name: Dependencies Linux
if: runner.os == 'Linux'
Expand Down Expand Up @@ -92,11 +97,13 @@ jobs:
cmake --version;
cmake -B ${{ steps.strings.outputs.build-output-dir }}
${{ matrix.cmake_options }}
-DCMAKE_CONFIGURATION_TYPES=Release
-DFINAL_VERSION=OFF
-DHUNTER_CONFIGURATION_TYPES=Release
-DHUNTER_ENABLED=ON
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_CONFIGURATION_TYPES=${{ matrix.build_type }}
-DHUNTER_CONFIGURATION_TYPES=${{ matrix.build_type }}
-DHUNTER_ROOT=${{ steps.strings.outputs.hunter-dir }}
-DHUNTER_ENABLED=ON
-DFINAL_VERSION=OFF
-DWITH_DRIVER_OPENAL=ON
-DWITH_DRIVER_OPENGL=ON
-DWITH_INSTALL_LIBRARIES=OFF
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ jobs:
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: ccache
uses: hendrikmuhs/[email protected]

- name: Dependencies
run: |
sudo apt update
Expand Down Expand Up @@ -77,6 +79,8 @@ jobs:
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DWITH_STATIC=ON
-DWITH_NEL_TESTS=ON
-DWITH_NEL_SAMPLES=ON
Expand Down
22 changes: 22 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,18 @@ jobs:
wget https://raw.githubusercontent.com/microsoft/msquic/main/src/inc/quic_sal_stub.h
sudo mv msquic.h msquic_posix.h quic_sal_stub.h /usr/include/
displayName: 'Dependencies'
- task: Cache@2
inputs:
key: 'ccache | Debug | ubuntu20'
path: '$(Pipeline.Workspace)/.ccache'
displayName: 'ccache'
- script: |
mkdir build
cmake --version
cd build
cmake -G "Ninja" -DCMAKE_SUPPRESS_REGENERATION=ON \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DWITH_STATIC=ON -DWITH_NEL_TESTS=ON -DWITH_NEL_SAMPLES=ON \
-DWITH_MSQUIC=ON \
-DWITH_LUA51=OFF -DWITH_LUA52=ON \
Expand All @@ -46,10 +53,14 @@ jobs:
-DWITH_QT5=ON -DWITH_LIBGSF=ON ..
cat CMakeCache.txt
displayName: 'CMake'
env:
CCACHE_DIR: '$(Pipeline.Workspace)/.ccache'
- script: |
cd build
ninja -j`nproc`
displayName: 'Make'
env:
CCACHE_DIR: '$(Pipeline.Workspace)/.ccache'
- script: |
cd nel/tools/nel_unit_test
../../../build/bin/nel_unit_test
Expand Down Expand Up @@ -88,11 +99,18 @@ jobs:
wget https://raw.githubusercontent.com/microsoft/msquic/main/src/inc/quic_sal_stub.h
sudo mv msquic.h msquic_posix.h quic_sal_stub.h /usr/include/
displayName: 'Dependencies'
- task: Cache@2
inputs:
key: 'ccache | Debug | ubuntu22'
path: '$(Pipeline.Workspace)/.ccache'
displayName: 'ccache'
- script: |
mkdir build
cmake --version
cd build
cmake -G "Ninja" -DCMAKE_SUPPRESS_REGENERATION=ON \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DWITH_STATIC=ON -DWITH_NEL_TESTS=ON -DWITH_NEL_SAMPLES=ON \
-DWITH_MSQUIC=ON \
-DWITH_LUA51=OFF -DWITH_LUA52=ON \
Expand All @@ -101,10 +119,14 @@ jobs:
-DWITH_QT5=ON -DWITH_LIBGSF=ON ..
cat CMakeCache.txt
displayName: 'CMake'
env:
CCACHE_DIR: '$(Pipeline.Workspace)/.ccache'
- script: |
cd build
ninja -j`nproc`
displayName: 'Make'
env:
CCACHE_DIR: '$(Pipeline.Workspace)/.ccache'
- script: |
cd nel/tools/nel_unit_test
../../../build/bin/nel_unit_test
Expand Down