Skip to content

Commit

Permalink
fix xmake.lua for android
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Nov 2, 2023
1 parent 54effec commit 30e8b72
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
arch: [armeabi-v7a, x86_64]
arch: [armeabi-v7a, arm64-v8a, x86_64]
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -23,9 +23,9 @@ jobs:
- name: Install Dependencies
run: |
sudo apt-get update -y && sudo apt-get install -yqq \
build-essential clang llvm libelf1 libelf-dev zlib1g-dev libc++-dev libc++abi-dev \
build-essential clang llvm zlib1g-dev libc++-dev libc++abi-dev \
sudo \
&& sudo apt-get -y clean
- name: Build xmake android examples/c
run: |
cd examples/c && xmake f -p android -a ${{ matrix.arch }} -m release -y && xmake -y
cd examples/c && xmake f -p android -a ${{ matrix.arch }} --require-bpftool=y -y && xmake -y
16 changes: 15 additions & 1 deletion examples/c/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,21 @@ else
add_requires("linux-headers")
end

add_includedirs("../../vmlinux")
if is_arch("arm64", "arm64-v8a") then
add_includedirs("../../vmlinux/arm64")
elseif is_arch("arm.*") then
add_includedirs("../../vmlinux/arm")
elseif is_arch("riscv32", "riscv64") then
add_includedirs("../../vmlinux/riscv")
elseif is_arch("loongarch") then
add_includedirs("../../vmlinux/loongarch")
elseif is_arch("ppc", "powerpc") then
add_includedirs("../../vmlinux/powerpc")
elseif is_arch("x86_64", "i386") then
add_includedirs("../../vmlinux/x86")
else
add_includedirs("../../vmlinux")
end

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

0 comments on commit 30e8b72

Please sign in to comment.