Skip to content

Commit cb962c4

Browse files
qmfrederikbording
authored andcommitted
Add 32-bit arm (armhf) support
1 parent 6844e70 commit cb962c4

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ matrix:
1717
dist: trusty
1818
sudo: required
1919
env: RID=linux-arm64
20+
- os: linux
21+
dist: trusty
22+
sudo: required
23+
env: RID=linux-arm
2024
- os: osx
2125
env: RID=osx
2226

CMakeLists.arm.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SET(CMAKE_SYSTEM_NAME Linux)
2+
set(CMAKE_SYSTEM_PROCESSOR arm)
3+
set(TARGET_ABI "linux-gnueabihf")
4+
5+
SET(CMAKE_C_COMPILER ${CMAKE_SYSTEM_PROCESSOR}-${TARGET_ABI}-gcc)
6+
SET(CMAKE_CXX_COMPILER ${CMAKE_SYSTEM_PROCESSOR}-${TARGET_ABI}-g++)

Dockerfile.linux-arm

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM debian:9
2+
WORKDIR /nativebinaries
3+
COPY . /nativebinaries/
4+
5+
RUN dpkg --add-architecture armhf
6+
7+
RUN apt update \
8+
&& apt -y install cmake pkg-config \
9+
crossbuild-essential-armhf
10+
11+
CMD ["/bin/bash", "-c", "./build.libgit2.sh"]

build.libgit2.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ pushd libgit2/build
2020

2121
export _BINPATH=`pwd`
2222

23+
if [[ $RID == *arm ]]; then
24+
export TOOLCHAIN_FILE=/nativebinaries/CMakeLists.arm.txt
25+
fi
26+
2327
if [[ $RID == *arm64 ]]; then
2428
export TOOLCHAIN_FILE=/nativebinaries/CMakeLists.arm64.txt
2529
fi

0 commit comments

Comments
 (0)