diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index 4a01f028..e34bfb90 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -47,6 +47,14 @@ jobs: gradle-manager-${{ hashFiles('**/*.gradle.kts') }} gradle-core gradle- + - name: Cache Cmake + uses: actions/cache@v2 + with: + path: ~/.ccache + key: ccache-${{ hashFiles('core/src/main/cpp') }} + restore-keys: ccache- + - name: Install ccache + run: sudo apt-get install -y ccache - name: Build with Gradle run: | echo 'org.gradle.caching=true' >> gradle.properties diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 626738e8..cb1156cb 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -95,6 +95,7 @@ android { arguments("-DRIRU_MODULE_API_VERSION=$moduleMaxRiruApiVersion", "-DRIRU_MODULE_VERSION=$verCode", "-DRIRU_MODULE_VERSION_NAME:STRING=\"$verName\"") + targets("lspd") } } diff --git a/core/src/main/cpp/CMakeLists.txt b/core/src/main/cpp/CMakeLists.txt index b8f4a48f..00cda415 100644 --- a/core/src/main/cpp/CMakeLists.txt +++ b/core/src/main/cpp/CMakeLists.txt @@ -20,6 +20,15 @@ cmake_minimum_required(VERSION 3.4.1) +find_program( CCACHE ccache ) + +if ( CCACHE ) + set( CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE} ) + set( CMAKE_C_COMPILER_LAUNCHER ${CCACHE} ) +else() + message( WARNING "Could not find CCache program." ) +endif() + link_libraries("-ffixed-x18") add_definitions(-DRIRU_MODULE) @@ -28,4 +37,4 @@ add_definitions(-DRIRU_MODULE_VERSION=${RIRU_MODULE_VERSION}) add_definitions(-DRIRU_MODULE_VERSION_NAME=${RIRU_MODULE_VERSION_NAME}) add_subdirectory(main) -add_subdirectory(external) \ No newline at end of file +add_subdirectory(external)