-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from xssfox/master
Add in cross compiling and github releases
- Loading branch information
Showing
2 changed files
with
46 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |