Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in cross compiling and github releases #2

Merged
merged 2 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 30 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
env:
global:
- GCC_BASE=gcc-arm-none-eabi-8-2018-q4-major
- GCC_SHORT=8-2018q4
sudo: required
language: generic
dist: xenial
os:
- linux
- osx
addons:
apt:
packages: libc6-i386 sox python3-numpy valgrind fonts-freefont-otf
libspeexdsp-dev libsamplerate0-dev portaudio19-dev
libasound2-dev libao-dev libgsm1-dev libsndfile-dev
cache:
directories:
- "$HOME/$GCC_BASE"
packages: libc6-i386 sox python3-numpy valgrind fonts-freefont-otf libspeexdsp-dev
libsamplerate0-dev portaudio19-dev libasound2-dev libao-dev libgsm1-dev libsndfile-dev
mingw-w64
homebrew:
packages:
- sox
update: true
install:
- export GCC_DIR=$HOME/$GCC_BASE
- export GCC_ARCHIVE=$HOME/$GCC_BASE-linux.tar.bz2
- export GCC_URL=https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/$GCC_SHORT/$GCC_BASE-linux.tar.bz2
- if [ ! -e $GCC_DIR/bin/arm-none-eabi-g++ ]; then wget -q $GCC_URL -O $GCC_ARCHIVE;
tar xfj $GCC_ARCHIVE -C $HOME; fi
- export HABLIBDIR=${PWD}
- export MAKEFLAGS=-j2

- export HABLIBDIR=${PWD}
- export MAKEFLAGS=-j2
script:
- cd ${HABLIBDIR} && mkdir -p build_linux && cd build_linux
- cmake $HABLIBDIR && make -j4
- ctest --output-on-failure
- cd ${HABLIBDIR} && mkdir -p build_windows/src && cd build_windows
- if [ "$TRAVIS_OS_NAME" != "osx" ]; then cmake $HABLIBDIR -DCMAKE_TOOLCHAIN_FILE=$HABLIBDIR/mingw-w64-x86_64.cmake && make -j4 ; fi

# build hablib -------------------------
- cd ${HABLIBDIR} && mkdir -p build_linux && cd build_linux
- cmake $HABLIBDIR && make -j4
# Now run all the ctests
- ctest --output-on-failure

before_deploy:
- cd ${HABLIBDIR}
deploy:
provider: releases
api_key:
secure: #Use travis setup releases to configure this
file:
- build_linux/src/libhorus.so # we might want to cross compile an arm version as well :)
- build_linux/src/libhorus.dylib
- build_windows/src/libhorus.dll
on:
repo: projecthorus/horusdemodlib
skip_cleanup: 'true'
16 changes: 16 additions & 0 deletions mingw-w64-x86_64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)

# cross compilers to use for C, C++ and Fortran
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)

# target environment on the build host system
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})

# modify default behavior of FIND_XXX() commands
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)