Add in cross compiling and github releases

pull/2/head
Michael Wheeler 2020-07-09 20:12:47 +10:00
rodzic 9dd4eafb27
commit b6f7e6d503
2 zmienionych plików z 43 dodań i 24 usunięć

Wyświetl plik

@ -1,33 +1,36 @@
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
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
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install sox; fi
- 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'

Wyświetl plik

@ -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)