Skip to content

Commit cf3c7c7

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

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM debian:9
2+
3+
WORKDIR /nativebinaries
4+
COPY . /nativebinaries/
5+
6+
RUN dpkg --add-architecture armhf
7+
8+
RUN apt update \
9+
&& apt -y install cmake pkg-config \
10+
crossbuild-essential-armhf \
11+
# pkg-config-arm-linux-gnueabi
12+
13+
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)