Skip to content

Commit

Permalink
功能: 可选择ndk及sdk版本
Browse files Browse the repository at this point in the history
  • Loading branch information
Vera-Firefly committed Nov 25, 2024
1 parent c911602 commit b99eec7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build

- name: Set Up Environment
run: |
sudo apt update
sudo apt install -y libxrandr-dev libxxf86vm-dev libxcb-*-dev libx11-xcb-dev libxfixes-dev libdrm-dev libx11-dev
pip3 install mako meson ninja
export ANDROID_NDK_HOME="$ANDROID_SDK_ROOT/ndk-bundle"
- name: Set ndkver,sdkver and work_dir
run: |
echo "NDK_VER=android-ndk-r27c" >> $GITHUB_ENV
echo "SDK_VER=33" >> $GITHUB_ENV
echo "WORK_DIR=$(pwd)" >> $GITHUB_ENV
- name: Download and extract NDK
run: |
echo "Downloading android-ndk from google server ..."
curl https://dl.google.com/android/repository/${NDK_VER}-linux.zip --output ${NDK_VER}-linux.zip &> /dev/null
echo "Extracting android-ndk to a folder ..."
unzip ${NDK_VER}-linux.zip &> /dev/null
- name: Build
run: |
envsubst <android-drm-${{matrix.arch}} >build-crossfile-drm
git clone https://gitlab.freedesktop.org/mesa/drm.git
cd drm
Expand Down
9 changes: 5 additions & 4 deletions android-aarch64
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[binaries]
ar = '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar'
c = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android33-clang']
cpp = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android33-clang++', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
ndk = '${WORK_DIR}/${NDK_VER}' + '/toolchains/llvm/prebuilt/linux-x86_64/bin'
ar = ndk + '/llvm-ar'
c = ['ccache', ndk + '/aarch64-linux-android${SDK_VER}-clang']
cpp = ['ccache', ndk + '/aarch64-linux-android${SDK_VER}-clang++', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
c_ld = 'lld'
cpp_ld = 'lld'
strip = '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip'
strip = ndk + '/aarch64-linux-android-strip'
pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=.', '/usr/bin/pkg-config']
[host_machine]
system = 'android'
Expand Down
9 changes: 5 additions & 4 deletions android-drm-aarch64
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[binaries]
ar = '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar'
c = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android33-clang', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC']
cpp = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android33-clang++', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
ndk = '${WORK_DIR}/${NDK_VER}' + '/toolchains/llvm/prebuilt/linux-x86_64/bin'
ar = ndk + '/llvm-ar'
c = ['ccache', ndk + '/aarch64-linux-android${SDK_VER}-clang', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC']
cpp = ['ccache', ndk + '/aarch64-linux-android${SDK_VER}-clang++', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
c_ld = 'lld'
cpp_ld = 'lld'
strip = '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip'
strip = ndk + '/llvm-strip'
pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=.', '/usr/bin/pkg-config']

[host_machine]
Expand Down

0 comments on commit b99eec7

Please sign in to comment.