Skip to content

Commit c3b645a

Browse files
committed
feat: add multi-arch build support for Linux ARM64 and macOS
1 parent 0ac3860 commit c3b645a

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v4
16-
with:
17-
submodules: recursive
1816

1917
- name: Set up JDK 21
2018
uses: actions/setup-java@v4
@@ -27,15 +25,27 @@ jobs:
2725
with:
2826
python-version: '3.x'
2927

30-
- name: Install dependencies (Linux)
28+
- name: Install Dependencies (Linux)
3129
if: runner.os == 'Linux'
3230
run: sudo apt-get update && sudo apt-get install -y libgles2-mesa-dev
3331

3432
- name: Build and Package
3533
run: python3 scripts/build.py
3634

35+
# For Linux ARM64, we use QEMU to run the build in an emulated environment
36+
- name: Build Linux ARM64
37+
if: runner.os == 'Linux'
38+
uses: uraimo/run-on-arch-action@v2
39+
with:
40+
arch: aarch64
41+
distro: ubuntu22.04
42+
install: |
43+
apt-get update && apt-get install -y python3 cmake build-essential openjdk-21-jdk libgles2-mesa-dev
44+
run: |
45+
python3 scripts/build.py
46+
3747
- name: Upload Artifacts
3848
uses: actions/upload-artifact@v4
3949
with:
4050
name: live2d-jars-${{ runner.os }}
41-
path: out/*.jar
51+
path: out/*.jar

native/src/CubismUserModel_JNI.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class JniUserModel : public CubismUserModel {
2020
~JniUserModel() {
2121
JNIEnv* env = getEnv();
2222
if (env) env->DeleteGlobalRef(_javaObj);
23-
// SDK's destructor handles _model, _renderer etc.
2423
}
2524

2625
void loadModelCopy(const csmByte* buffer, csmSizeInt size) {

scripts/build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def get_tag():
5555
os_name = platform.system().lower()
5656
arch = platform.machine().lower()
5757
p = "macos" if "darwin" in os_name else os_name
58+
# Handle aarch64 vs arm64 naming
5859
a = "arm64" if ("arm" in arch or "aarch64" in arch) else "x64"
5960
return f"{p}-{a}"
6061

0 commit comments

Comments
 (0)