@@ -40,12 +40,25 @@ jobs:
4040 artifact_name : ccap-linux-x86_64
4141 build_type : Release
4242
43+ - os : ubuntu-latest
44+ name : Linux ARM64
45+ artifact_name : ccap-linux-arm64
46+ build_type : Release
47+ arch : arm64
48+
4349 runs-on : ${{ matrix.os }}
4450
4551 steps :
4652 - name : Checkout code
4753 uses : actions/checkout@v4
4854
55+ - name : Setup cross-compilation for ARM64
56+ if : matrix.arch == 'arm64'
57+ shell : bash
58+ run : |
59+ sudo apt-get update
60+ sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
61+
4962 - name : Setup Visual Studio (Windows)
5063 if : matrix.os == 'windows-latest'
5164 uses : microsoft/setup-msbuild@v1.1
5871 cmake -B build -G "Visual Studio 17 2022" -A x64 -DCCAP_BUILD_EXAMPLES=ON -DCCAP_BUILD_TESTS=OFF
5972 elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
6073 # Linux: Use single-config generator
61- cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCCAP_BUILD_EXAMPLES=ON -DCCAP_BUILD_TESTS=OFF
74+ if [ "${{ matrix.arch }}" = "arm64" ]; then
75+ # ARM64 cross-compilation
76+ cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
77+ -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
78+ -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
79+ -DCMAKE_SYSTEM_NAME=Linux \
80+ -DCMAKE_SYSTEM_PROCESSOR=aarch64 \
81+ -DCCAP_BUILD_EXAMPLES=ON -DCCAP_BUILD_TESTS=OFF
82+ else
83+ # Regular Linux x86_64
84+ cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCCAP_BUILD_EXAMPLES=ON -DCCAP_BUILD_TESTS=OFF
85+ fi
6286 else
6387 # macOS: Use single-config generator with universal binary
6488 cmake -B build -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCCAP_BUILD_EXAMPLES=ON -DCCAP_BUILD_TESTS=OFF
@@ -131,7 +155,7 @@ jobs:
131155 find build -name "*-example_with_glfw" -exec cp {} package/examples/ \; || echo "Examples not found"
132156
133157 - name : Copy libraries (Linux)
134- if : matrix.os == 'ubuntu-latest'
158+ if : matrix.os == 'ubuntu-latest' && matrix.arch != 'arm64'
135159 shell : bash
136160 run : |
137161 # Copy static library
@@ -147,6 +171,23 @@ jobs:
147171 find build -name "3-capture_callback" -exec cp {} package/examples/ \; || echo "Examples not found"
148172 find build -name "4-example_with_glfw" -exec cp {} package/examples/ \; || echo "Examples not found"
149173
174+ - name : Copy libraries (Linux ARM64)
175+ if : matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64'
176+ shell : bash
177+ run : |
178+ # Copy static library
179+ cp build/libccap.a package/lib/ || echo "Static library not found"
180+
181+ # Copy dynamic library (if exists)
182+ cp build/libccap.so package/lib/ || echo "Dynamic library not found"
183+
184+ # Copy example programs (ARM64 cross-compiled)
185+ find build -name "0-print_camera" -exec cp {} package/examples/ \; || echo "Examples not found"
186+ find build -name "1-minimal_example" -exec cp {} package/examples/ \; || echo "Examples not found"
187+ find build -name "2-capture_grab" -exec cp {} package/examples/ \; || echo "Examples not found"
188+ find build -name "3-capture_callback" -exec cp {} package/examples/ \; || echo "Examples not found"
189+ find build -name "4-example_with_glfw" -exec cp {} package/examples/ \; || echo "Examples not found"
190+
150191 - name : Copy headers and other files
151192 shell : bash
152193 run : |
@@ -260,19 +301,22 @@ jobs:
260301 **Supported Platforms:**
261302 - **macOS** (Universal Binary - supports Intel & Apple Silicon): `ccap-macos-universal.tar.gz`
262303 - **Windows** (MSVC x64 - includes Debug and Release versions): `ccap-msvc-x86_64.zip`
263- - **Linux** (x86_64 - compatible with most distributions): `ccap-linux-x86_64.tar.gz`
304+ - **Linux x86_64** (compatible with most distributions): `ccap-linux-x86_64.tar.gz`
305+ - **Linux ARM64** (compatible with Raspberry Pi, ARM servers, and other ARM64 boards): `ccap-linux-arm64.tar.gz`
264306
265307 ### 📁 Package Contents
266308
267309 - **Library Files**: Static library files for linking
268310 - Windows: `lib/ccap.lib` (Release version) and `lib/ccapd.lib` (Debug version)
269311 - macOS: `lib/libccap.a` (Universal Binary)
270- - Linux: `lib/libccap.a` (x86_64)
312+ - Linux x86_64: `lib/libccap.a` (x86_64)
313+ - Linux ARM64: `lib/libccap.a` (ARM64)
271314 - **Header Files**: Complete C++ API header files
272315 - **Example Programs**: 5 complete usage examples
273316 - Windows: `examples/Release/` and `examples/Debug/` directories contain corresponding versions
274317 - macOS: `examples/` directory contains executable files
275- - Linux: `examples/` directory contains executable files
318+ - Linux x86_64: `examples/` directory contains executable files
319+ - Linux ARM64: `examples/` directory contains executable files
276320 - **Example Source Code**: Ready-to-compile example code
277321 - **Documentation**: README and build instructions
278322 - **CMake Configuration**: Easy integration with other CMake projects
@@ -286,7 +330,8 @@ jobs:
286330 - **Windows Debug**: Link `lib/ccapd.lib`
287331 - **Windows Release**: Link `lib/ccap.lib`
288332 - **macOS**: Link `lib/libccap.a`
289- - **Linux**: Link `lib/libccap.a`
333+ - **Linux x86_64**: Link `lib/libccap.a`
334+ - **Linux ARM64**: Link `lib/libccap.a`
290335 5. Refer to example code in the `examples` directory
291336
292337 ### 📋 System Requirements
@@ -331,5 +376,6 @@ jobs:
331376 echo "- ccap-macos-universal.tar.gz" >> $GITHUB_STEP_SUMMARY
332377 echo "- ccap-msvc-x86_64.zip (includes Debug and Release versions)" >> $GITHUB_STEP_SUMMARY
333378 echo "- ccap-linux-x86_64.tar.gz" >> $GITHUB_STEP_SUMMARY
379+ echo "- ccap-linux-arm64.tar.gz" >> $GITHUB_STEP_SUMMARY
334380 echo "" >> $GITHUB_STEP_SUMMARY
335381 echo "Release page: ${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
0 commit comments