diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a7626d14b..00abba7c60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -239,7 +239,7 @@ jobs: run: . scripts/setenv -q && get-discord-rpc - name: Build OpenRCT2 shell: bash - run: . scripts/setenv -q && build -DCMAKE_BUILD_TYPE=Release -DAPPIMAGE=ON -DOPENRCT2_USE_CCACHE=off + run: . scripts/setenv -q && build -DCMAKE_BUILD_TYPE=Release -DAPPIMAGE=ON -DOPENRCT2_USE_CCACHE=on - name: Build AppImage shell: bash run: . scripts/setenv -q && build-appimage @@ -306,6 +306,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v1 + - name: ccache + uses: hendrikmuhs/ccache-action@v1 - name: Build OpenRCT2 shell: bash run: | diff --git a/src/openrct2-android/app/src/main/CMakeLists.txt b/src/openrct2-android/app/src/main/CMakeLists.txt index 8dc2be331a..f5ef191a8b 100644 --- a/src/openrct2-android/app/src/main/CMakeLists.txt +++ b/src/openrct2-android/app/src/main/CMakeLists.txt @@ -146,6 +146,19 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++1z ${COMMON_COMPILE_OPTIONS} -Wnon-virtual-dtor") get_filename_component(ORCT2_ROOT "${CMAKE_SOURCE_DIR}/../../../../../" REALPATH) +list(APPEND CMAKE_MODULE_PATH "${ORCT2_ROOT}/cmake") + +find_package(CCache) + +if (CCache_FOUND) + option(OPENRCT2_USE_CCACHE "Use CCache to improve recompilation speed (optional)" ON) + if (OPENRCT2_USE_CCACHE) + # Use e.g. "ccache clang++" instead of "clang++" + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCache_EXECUTABLE}") + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCache_EXECUTABLE}") + endif (OPENRCT2_USE_CCACHE) +endif (CCache_FOUND) + file(GLOB_RECURSE LIBOPENRCT2_SOURCES "${ORCT2_ROOT}/src/openrct2/*.cpp" "${ORCT2_ROOT}/src/openrct2/*.h"