@@ -51,9 +51,9 @@ inputs:
5151 required : false
5252 default : " "
5353 ccache-variant :
54- description : The ccache variant to use (empty, ccache or sccache). Defaults to sccache
54+ description : The ccache variant to use (empty, ccache or sccache). Defaults to sccache on Windows and Android, empty otherwise
5555 required : false
56- default : sccache
56+ default : default
5757 use-cpm-cache :
5858 description : Whether to cache CPM sources. Defaults to true
5959 required : false
9292 shell : bash
9393 run : |
9494 DEFAULT_TARGET=Win64
95+ DEFAULT_CCACHE=sccache
9596 if [ "$RUNNER_OS" = "Linux" ]; then
9697 ID=linux
9798 DEFAULT_TARGET=Android64
@@ -101,6 +102,12 @@ runs:
101102 elif [ "$RUNNER_OS" = "macOS" ]; then
102103 ID=mac
103104 DEFAULT_TARGET=MacOS
105+ DEFAULT_CCACHE=
106+ fi
107+
108+ CCACHE_VARIANT=${{ inputs.ccache-variant }}
109+ if [ "$CCACHE_VARIANT" = "default" ]; then
110+ CCACHE_VARIANT=$DEFAULT_CCACHE
104111 fi
105112
106113 TARGET=${{ inputs.target }}
@@ -123,6 +130,7 @@ runs:
123130 echo "id=$ID" >> $GITHUB_OUTPUT
124131 echo "target=$TARGET" >> $GITHUB_OUTPUT
125132 echo "target_id=$OUTPUT_ID" >> $GITHUB_OUTPUT
133+ echo "ccache_variant=$CCACHE_VARIANT" >> $GITHUB_OUTPUT
126134
127135 # https://github.com/mozilla/sccache/issues/2090
128136 - name : Download custom sccache
@@ -134,10 +142,10 @@ runs:
134142 tarBall : false
135143 zipBall : false
136144 out-file-path : " epic-sccache"
137- if : steps.platform.outputs.id == 'mac' && inputs.ccache-variant != ''
145+ if : steps.platform.outputs.id == 'mac' && steps.platform.outputs.ccache_variant != ''
138146
139147 - name : Setup custom sccache
140- if : steps.platform.outputs.id == 'mac' && inputs.ccache-variant != ''
148+ if : steps.platform.outputs.id == 'mac' && steps.platform.outputs.ccache_variant != ''
141149 shell : bash
142150 run : |
143151 7z x "epic-sccache/sccache-*-x86_64-apple-darwin.zip" -o"epic-sccache"
@@ -148,9 +156,9 @@ runs:
148156 - name : Setup sccache
149157 uses : hendrikmuhs/ccache-action@v1
150158 with :
151- variant : ${{ inputs.ccache-variant }}
159+ variant : ${{ steps.platform.outputs.ccache_variant }}
152160 key : ${{ steps.platform.outputs.target_id }}-v1
153- if : inputs.ccache-variant != ''
161+ if : steps.platform.outputs.ccache_variant != ''
154162
155163 - name : Setup CPM Cache
156164 if : inputs.use-cpm-cache == 'true'
@@ -266,7 +274,7 @@ runs:
266274 cd "${{ inputs.path }}"
267275 CMAKE_EXTRA_ARGS=""
268276 if [ ${{ steps.platform.outputs.target_id }} = "mac" ]; then
269- CMAKE_EXTRA_ARGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DGEODE_DISABLE_PRECOMPILED_HEADERS=OFF -DCMAKE_AR='/usr/bin/ar' -DCMAKE_RANLIB='/usr/bin/ranlib'"
277+ CMAKE_EXTRA_ARGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DGEODE_DISABLE_PRECOMPILED_HEADERS=OFF -DCMAKE_AR='/usr/bin/ar' -DCMAKE_RANLIB='/usr/bin/ranlib'"
270278 elif [ ${{ steps.platform.outputs.target_id }} = "android32" ]; then
271279 CMAKE_EXTRA_ARGS="-DCMAKE_TOOLCHAIN_FILE=$NDK_PATH/build/cmake/android.toolchain.cmake -DANDROID_STL=c++_shared -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-${{ inputs.android-min-sdk }}"
272280 elif [ ${{ steps.platform.outputs.target_id }} = "android64" ]; then
@@ -280,8 +288,8 @@ runs:
280288 if [ "${{ inputs.bundle-pdb }}" = "true" ] && [ ${{ steps.platform.outputs.id }} = "win" ]; then
281289 CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DGEODE_BUNDLE_PDB=ON"
282290 fi
283- if [ -n "${{ inputs.ccache-variant }}" ]; then
284- CCACHE_PATH="$(which "${{ inputs.ccache-variant }}")"
291+ if [ -n "${{ steps.platform.outputs.ccache_variant }}" ]; then
292+ CCACHE_PATH="$(which "${{ steps.platform.outputs.ccache_variant }}")"
285293 CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DCMAKE_C_COMPILER_LAUNCHER=${CCACHE_PATH} -DCMAKE_CXX_COMPILER_LAUNCHER=${CCACHE_PATH}"
286294 fi
287295 cmake -B build -DCMAKE_BUILD_TYPE=${{ inputs.build-config }} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DGEODE_CODEGEN_CMAKE_ARGS="-DCMAKE_C_COMPILER=clang;-DCMAKE_CXX_COMPILER=clang++;-G Ninja" -G Ninja $CMAKE_EXTRA_ARGS -DGEODE_DONT_INSTALL_MODS=ON -DGEODE_TARGET_PLATFORM=${{ steps.platform.outputs.target }} ${{ inputs.configure-args }}
0 commit comments