Skip to content

Commit

Permalink
CI: Add arm-linux-musleabi
Browse files Browse the repository at this point in the history
  • Loading branch information
xfangfang committed May 11, 2024
1 parent 5bde575 commit 9d87c9f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
- { target: x86_64-windows-gnu, os: ubuntu-latest, strip: "llvm-strip", upx: "upx --lzma", cmake: "-DUSE_SYSTEM_PCAP=OFF -DPacket_ROOT=/tmp/sdk", ext: ".exe"}
- { target: x86_64-linux-musl, os: ubuntu-latest, strip: "llvm-strip", upx: "upx --lzma", cmake: "-DUSE_SYSTEM_PCAP=OFF" }
- { target: aarch64-linux-musl, os: ubuntu-latest, strip: "llvm-strip", upx: "upx --lzma", cmake: "-DUSE_SYSTEM_PCAP=OFF" }
- { target: mipsel-linux-musl, os: ubuntu-latest, strip: "llvm-strip", upx: "upx --lzma", cmake: "-DUSE_SYSTEM_PCAP=OFF" }
- { target: arm-linux-musleabi",os: ubuntu-latest, strip: "llvm-strip", upx: "upx --lzma", cmake: "-DUSE_SYSTEM_PCAP=OFF -DZIG_COMPILE_OPTION='-march=armv7;-mcpu=cortex_a9'" }
- { target: mipsel-linux-musl, os: ubuntu-latest, strip: "llvm-strip", upx: "upx --lzma", cmake: "-DUSE_SYSTEM_PCAP=OFF -DZIG_COMPILE_OPTION='-msoft-float'" }
steps:
- uses: actions/checkout@v4

Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ if (ZIG_TARGET)
include(${CMAKE_SOURCE_DIR}/cmake/zig.cmake)
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/cmake/zig.toolchain.cmake")
add_compile_options(--target=${ZIG_TARGET})
if(ZIG_TARGET_ARCH MATCHES "mips")
add_compile_options(-msoft-float)
add_link_options(-msoft-float)
message(STATUS "Custom compile options: ${ZIG_COMPILE_OPTION}")
if (ZIG_COMPILE_OPTION)
add_compile_options(${ZIG_COMPILE_OPTION})
add_link_options(${ZIG_COMPILE_OPTION})
endif ()
endif ()

Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ but you can also let cmake automatically compile pcap by using `-DUSE_SYSTEM_PCA
cmake -B build
cmake --build build pppwn

# cross compile for mipsel linux
cmake -B build -DZIG_TARGET=mipsel-linux-musl -DUSE_SYSTEM_PCAP=OFF
# cross compile for mipsel linux (soft float)
cmake -B build -DZIG_TARGET=mipsel-linux-musl -DUSE_SYSTEM_PCAP=OFF -DZIG_COMPILE_OPTION="-msoft-float"
cmake --build build pppwn

# cross compile for armv7 cortex-a9 linux
cmake -B build -DZIG_TARGET=arm-linux-musleabi -DUSE_SYSTEM_PCAP=OFF -DZIG_COMPILE_OPTION="-march=armv7;-mcpu=cortex_a9"
cmake --build build pppwn

# cross compile for Windows
Expand Down

0 comments on commit 9d87c9f

Please sign in to comment.