Skip to content

Commit

Permalink
Use c++ modules
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 committed Apr 28, 2024
1 parent bad5473 commit b90bc85
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ jobs:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- uses: seanmiddleditch/gha-setup-ninja@master
with:
version: 1.12.0
- name: Set up ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
distribution: 'temurin'
java-version: 17
cache: 'gradle'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- uses: seanmiddleditch/gha-setup-ninja@master
with:
version: 1.12.0
- name: Retrieve version
run: |
echo VERSION=$(echo ${{ github.event.head_commit.id }} | head -c 10) >> $GITHUB_ENV
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
namespace = "me.iacn.biliroaming"
compileSdk = 34
buildToolsVersion = "34.0.0"
ndkVersion = "26.0.10792818"
ndkVersion = "27.0.11718014-beta1"

buildFeatures {
prefab = true
Expand Down Expand Up @@ -115,7 +115,7 @@ android {
externalNativeBuild {
cmake {
path("src/main/jni/CMakeLists.txt")
version = "3.22.1+"
version = "3.28.0+"
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 3.4.1)
cmake_minimum_required(VERSION 3.28)
project(biliroaming)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_SCAN_FOR_MODULES ON)

find_package(cxx REQUIRED CONFIG)
link_libraries(cxx::cxx)

Expand Down
5 changes: 4 additions & 1 deletion app/src/main/jni/biliroaming.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <android/log.h>
#include <dex_helper.h>
#include <fcntl.h>
#include <jni.h>
#include <list>
Expand All @@ -8,6 +7,10 @@
#include <sys/stat.h>
#include <unistd.h>
#include <zlib.h>
#include <string>
#include <string_view>

import dex_helper;

#define LOG_TAG "BiliRoaming"
#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
Expand Down

0 comments on commit b90bc85

Please sign in to comment.