Building C/C++ Project with Travis CI for Multiple OSs and CPUs

  • ARM32 Linux: Raspberry Pi
  • ARM64 Linux: Jetson Nano

Barcode SDK for Linux(AMD64, ARM64, ARM32), Windows(x86, x64), and macOS

CMake Configuration for ARM32 and ARM64 Barcode SDK

if (CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
MESSAGE( STATUS "Link directory: ${PROJECT_SOURCE_DIR}/platforms/linux/" )
link_directories("${PROJECT_SOURCE_DIR}/platforms/linux/")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l OR ARM32_BUILD)
MESSAGE( STATUS "Link directory: ${PROJECT_SOURCE_DIR}/platforms/arm32/" )
link_directories("${PROJECT_SOURCE_DIR}/platforms/arm32/")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
MESSAGE( STATUS "Link directory: ${PROJECT_SOURCE_DIR}/platforms/aarch64/" )
link_directories("${PROJECT_SOURCE_DIR}/platforms/aarch64/")
endif()
option(ARM32_BUILD "Build for ARM32" OFF)

Configuring Travis.yml for Different OSs and CPUs

jobs:
include:
- os: linux
arch: arm64
env: OS=arm64_linux
- os: linux
arch: amd64
env: OS=amd64_linux
- os: windows
arch: amd64
env: OS=windows
- os: osx
arch: amd64
env: OS=osx
- os: linux
arch: arm64
env: OS=arm32_linux
before_install:
- sudo dpkg --add-architecture armhf
- sudo apt-get update
- sudo apt-get install crossbuild-essential-armhf libc6:armhf libstdc++6:armhf
script:
- mkdir build
- cd build
- if [[ ${TRAVIS_OS_NAME} == "windows" ]]; then
cmake -DCMAKE_GENERATOR_PLATFORM=x64 ..;
else
if [ $OS == "arm32_linux" ]; then
export CC=arm-linux-gnueabihf-gcc;
export CXX=arm-linux-gnueabihf-g++;
export AR=arm-linux-gnueabihf-ar;
cmake -DARM32_BUILD=TRUE ..;
else
cmake ..;
fi
fi
- cmake --build . --config release
[![status](https://api.travis-ci.com/Dynamsoft/cmake.svg?branch=master)](https://travis-ci.com/github/Dynamsoft/cmake)

Source Code

--

--

--

Manager of Dynamsoft Open Source Projects | Tech Lover

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

DNAxCAT x IM community AMA RECAP

Xamarin vs React Native — Platform Frameworks

!鬼灭之刃剧场版:无限列车篇”Demon Slayer: Kimetsu no Yaiba”~HDQ-完整版电影在线”2020!花江夏樹~TW

Creating Security Dashboards for Azure Sentinel with Grafana

TryHackMe: Simple CTF

Microservices reached the financial sector — so that you can reach your goals!

Android MVI with Coroutine Pattern

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Xiao Ling

Xiao Ling

Manager of Dynamsoft Open Source Projects | Tech Lover

More from Medium

Embedded — system perspective

How to Evaluate the Performance of a Biometric System?

ELK Dealing with Mappings | Part4

Rabbit MQ Consume message as batch