Skip to content

Commit 7b1c6e3

Browse files
waruqianakryiko
authored andcommitted
fix xmake.lua for android
Signed-off-by: ruki <waruqi@gmail.com>
1 parent bf4e605 commit 7b1c6e3

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

.github/workflows/build-android.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
arch: [armeabi-v7a, x86_64]
15+
arch: [armeabi-v7a, arm64-v8a, x86_64]
1616
steps:
1717
- uses: actions/checkout@v2
1818
with:
@@ -23,9 +23,9 @@ jobs:
2323
- name: Install Dependencies
2424
run: |
2525
sudo apt-get update -y && sudo apt-get install -yqq \
26-
build-essential clang llvm libelf1 libelf-dev zlib1g-dev libc++-dev libc++abi-dev \
26+
build-essential clang llvm zlib1g-dev libc++-dev libc++abi-dev \
2727
sudo \
2828
&& sudo apt-get -y clean
2929
- name: Build xmake android examples/c
3030
run: |
31-
cd examples/c && xmake f -p android -a ${{ matrix.arch }} -m release -y && xmake -y
31+
cd examples/c && xmake f -p android -a ${{ matrix.arch }} --require-bpftool=y -y && xmake -y

examples/c/xmake.lua

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,21 @@ else
2121
add_requires("linux-headers")
2222
end
2323

24-
add_includedirs("../../vmlinux")
24+
if is_arch("arm64", "arm64-v8a") then
25+
add_includedirs("../../vmlinux/arm64")
26+
elseif is_arch("arm.*") then
27+
add_includedirs("../../vmlinux/arm")
28+
elseif is_arch("riscv32", "riscv64") then
29+
add_includedirs("../../vmlinux/riscv")
30+
elseif is_arch("loongarch") then
31+
add_includedirs("../../vmlinux/loongarch")
32+
elseif is_arch("ppc", "powerpc") then
33+
add_includedirs("../../vmlinux/powerpc")
34+
elseif is_arch("x86_64", "i386") then
35+
add_includedirs("../../vmlinux/x86")
36+
else
37+
add_includedirs("../../vmlinux")
38+
end
2539

2640
-- we can run `xmake f --require-bpftool=y` to pull bpftool from xmake-repo repository
2741
if has_config("require-bpftool") then

0 commit comments

Comments
 (0)