diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 627de240..1cea2c94 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -45,11 +45,14 @@ jobs: packages: ccache libvulkan-dev glslang-tools spirv-tools libwayland-dev libxrandr-dev ${{matrix.config.packages}} ${{ startsWith(matrix.config.preset, 'server') && env.SERVER_DEPS || ''}} - name: ccache - uses: hendrikmuhs/ccache-action@v1.2.23 + uses: hendrikmuhs/ccache-action@v1.2.24 with: - key: linux-${{matrix.config.preset}} - job-summary: "" - restore-keys: linux- + # The trailing "." keeps one preset's key from being a prefix of another's + key: linux-${{matrix.config.preset}}. + verbose: 1 + job-summary: '' + evict-old-files: job + save: ${{ github.ref == 'refs/heads/master' }} - uses: actions/cache@v5 with: @@ -139,10 +142,14 @@ jobs: packages: librsvg2-bin npm - name: ccache - uses: hendrikmuhs/ccache-action@v1.2.23 + uses: hendrikmuhs/ccache-action@v1.2.24 with: key: steam-frame - job-summary: "" + verbose: 1 + job-summary: '' + evict-old-files: job + save: ${{ github.ref == 'refs/heads/master' }} + restore-keys: steam-frame - uses: actions/cache@v5 with: @@ -289,6 +296,16 @@ jobs: ${{github.workspace}}/cmake-fetch/*.tgz restore-keys: cmake-android- + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2.24 + with: + # The trailing "." keeps one build type's key from being a prefix of another's + key: android-${{matrix.buildtype}}. + verbose: 1 + job-summary: '' + evict-old-files: job + save: ${{ github.ref == 'refs/heads/master' }} + # Gradle distribution and the Android plugin's dependencies. - uses: actions/cache@v5 with: @@ -330,6 +347,9 @@ jobs: echo "$APK_KEYSTORE_BASE64" | base64 --decode --ignore-garbage > ks.keystore - name: Build + env: + # Paths under the workspace are hashed relative to it + CCACHE_BASEDIR: ${{github.workspace}} run: | VERSION=$(git describe --tags --always | sed "s/^v\([0-9]\)/\1/") if [ ${{ matrix.buildtype }} = 'Oculus' ] @@ -367,6 +387,7 @@ jobs: -Pwivrn_app_name="$APPNAME" \ -Pwivrn_compress_glb=ON \ -Pfetchcontent_base_dir=${{github.workspace}}/cmake-fetch \ + -Pcompiler_launcher=ccache \ assemble${{ matrix.buildtype }} - name: Upload build dir diff --git a/CMakeLists.txt b/CMakeLists.txt index 93b78732..97675a83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD 23) +set(CMAKE_CXX_SCAN_FOR_MODULES OFF) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) if(ANDROID) diff --git a/build.gradle b/build.gradle index 1161658d..0359c18d 100644 --- a/build.gradle +++ b/build.gradle @@ -117,6 +117,8 @@ android { def compressGlb = project.hasProperty('wivrn_compress_glb') ? wivrn_compress_glb : 'OFF' def fetchcontentBaseDir = project.hasProperty('fetchcontent_base_dir') ? ['-DFETCHCONTENT_BASE_DIR=' + fetchcontent_base_dir] : [] + def compilerLauncher = project.hasProperty('compiler_launcher') ? ['-DCMAKE_C_COMPILER_LAUNCHER=' + compiler_launcher, '-DCMAKE_CXX_COMPILER_LAUNCHER=' + compiler_launcher] : [] + def asan = use_asan ? 'ON': 'OFF' def stl = use_asan ? 'c++_shared' : "c++_static" @@ -146,7 +148,8 @@ android { '-DWIVRN_COMPRESS_GLB=' + compressGlb, '-DWIVRN_ADDRESS_SANITIZER=' + asan, ] + - fetchcontentBaseDir + fetchcontentBaseDir + + compilerLauncher resValue "string", "app_name", project.hasProperty('wivrn_app_name') ? project.wivrn_app_name : "WiVRn Local" abiFilters 'arm64-v8a'//, 'x86_64' }