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

Update for package distribution #955

Merged
merged 11 commits into from
May 19, 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
95 changes: 60 additions & 35 deletions .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,64 @@ echo "----"
echo "WORK DIR:$DIR"
DIR=$PWD

if [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo apt-get update -qq || true
sudo apt-get install -qq -y --no-install-recommends libgtk-3-dev

echo "--> Building Debug..."
mkdir -p build/Debug && cd build/Debug
echo "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/_install"
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/_install ../../
make && make package && cd -

echo "--> Building Release..."
mkdir -p build/Release && cd build/Release
echo "-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/_install"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/_install ../../
make && make package && cd -

# echo "--> Building Binary..."
# mkdir -p build/Binary && cd build/Binary
# cho "-DCMAKE_BUILD_TYPE=Binary -DCMAKE_INSTALL_PREFIX=$PWD/_install"
# cmake -DCMAKE_BUILD_TYPE=Binary -DCMAKE_TOOLCHAIN_FILE=./cmake/linux-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$PWD/_install ../../
# make && make package && cd -
else [ "$TRAVIS_OS_NAME" == "osx" ];
brew install libusb

echo "--> Building Debug..."
mkdir -p build/Debug && cd build/Debug
echo "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/_install"
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/_install ../../
make && make package && cd -

echo "--> Building Release..."
mkdir -p build/Release && cd build/Release
echo "-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/_install"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/_install ../../
make && make package && cd -
if [ "$TRAVIS_JOB_NAME" == "linux-mingw" ]; then
echo "--> Building Release for Windows (x86-64) ..."
mkdir -p build-mingw && cd build-mingw
echo "-DCMAKE_SYSTEM_NAME=Windows -DTOOLCHAIN_PREFIX=x86_64-w64-mingw32 \
-DCMAKE_TOOLCHAIN_FILE=$PWD/../cmake/modules/set_toolchain.cmake -DCMAKE_INSTALL_PREFIX=$PWD/install $DIR"
cmake -DCMAKE_SYSTEM_NAME=Windows -DTOOLCHAIN_PREFIX=x86_64-w64-mingw32 \
-DCMAKE_TOOLCHAIN_FILE=$PWD/../cmake/modules/set_toolchain.cmake -DCMAKE_INSTALL_PREFIX=$PWD/install $DIR
make && rm -rf build-mingw && cd -

echo "--> Building Release for Windows (i686) ..."
mkdir -p build-mingw && cd build-mingw
echo "-DCMAKE_SYSTEM_NAME=Windows -DTOOLCHAIN_PREFIX=i686-w64-mingw32 \
-DCMAKE_TOOLCHAIN_FILE=$PWD/../cmake/modules/set_toolchain.cmake -DCMAKE_INSTALL_PREFIX=$PWD/install $DIR"
cmake -DCMAKE_SYSTEM_NAME=Windows -DTOOLCHAIN_PREFIX=i686-w64-mingw32 \
-DCMAKE_TOOLCHAIN_FILE=$PWD/../cmake/modules/set_toolchain.cmake -DCMAKE_INSTALL_PREFIX=$PWD/install $DIR
make && rm -rf build-mingw && cd -

elif [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo apt-get update -qq || true
sudo apt-get install -qq -y --no-install-recommends libgtk-3-dev

echo "--> Building Debug..."
mkdir -p build/Debug && cd build/Debug
echo "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install"
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install $DIR
make && cd -

echo "--> Building Release with package..."
mkdir -p build/Release && cd build/Release
echo "-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install $DIR
make package && cd -

elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew install libusb

echo "--> Building Debug..."
mkdir -p build/Debug && cd build/Debug
echo "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install"
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install $DIR
make && cd -

echo "--> Building Release with package..."
mkdir -p build/Release && cd build/Release
echo "-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install $DIR
make package && cd -

else # local test-build
echo "--> Building Debug..."
mkdir -p build/Debug && cd build/Debug
echo "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install"
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install ../../
make && cd -

echo "--> Building Release with package..."
mkdir -p build/Release && cd build/Release
echo "-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install ../../
make package && cd -
fi
101 changes: 60 additions & 41 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,98 +1,111 @@
language: c

matrix:
jobs:
include:
### 64-bit builds ###
### 64-bit builds on AMD64 ###
- os: linux
dist: bionic
env: BADGE=linux
arch: x64
compiler: gcc-5
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-5', 'libusb-1.0.0-dev', 'libgtk-3-dev']
packages: ['gcc-5', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
- os: linux
dist: bionic
env: BADGE=linux
arch: x64
compiler: gcc-7
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-7', 'libusb-1.0.0-dev', 'libgtk-3-dev']
- os: linux
env: BADGE=linux
arch: x64
compiler: gcc-9
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-9', 'libusb-1.0.0-dev', 'libgtk-3-dev']
packages: ['gcc-9', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
- os: linux
dist: xenial
env: BADGE=linux
arch: x64
compiler: clang-3.7
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-3.7']
packages: ['clang-3.7', 'libusb-1.0.0-dev', 'libgtk-3-dev']
packages: ['clang-3.7', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
- os: linux
dist: bionic
env: BADGE=linux
arch: x64
compiler: clang-6.0
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-bionic-6.0']
packages: ['clang-6.0', 'libusb-1.0.0-dev', 'libgtk-3-dev']
# - os: linux
# arch: x64
# compiler: clang-6.0
# addons:
# apt:
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-bionic-6.0']
# packages: ['clang-6.0', 'libusb-1.0.0-dev', 'libgtk-3-dev']
# env: CFLAGS=-m32 LDFLAGS=-m32

### 32-bit builds ###
packages: ['clang-6.0', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
- os: linux
dist: bionic
env: BADGE=linux
arch: x86
compiler: gcc-5
compiler: clang-9
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['clang-9', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']

- os: linux
dist: bionic
env: BADGE=linux-mingw
name: linux-mingw
compiler: gcc-9
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-5', 'libusb-1.0.0-dev', 'libgtk-3-dev']
packages: ['gcc-9', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm', 'mingw-w64']

### 32-bit builds on AMD64 ###
- os: linux
dist: bionic
env: BADGE=linux
arch: x86
compiler: gcc-7
compiler: gcc-5
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-7', 'libusb-1.0.0-dev', 'libgtk-3-dev']
packages: ['gcc-5', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
before_install:
- CFLAGS="$CFLAGS -m32"; CXXFLAGS="$CXXFLAGS -m32"; LDFLAGS="$LDFLAGS -m32";
- os: linux
dist: bionic
env: BADGE=linux
arch: x86
compiler: gcc-9
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-9', 'libusb-1.0.0-dev', 'libgtk-3-dev']
packages: ['gcc-9', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
before_install:
- CFLAGS="$CFLAGS -m32"; CXXFLAGS="$CXXFLAGS -m32"; LDFLAGS="$LDFLAGS -m32";
- os: linux
dist: xenial
env: BADGE=linux
arch: x86
compiler: clang-3.7
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-3.7']
packages: ['clang-3.7', 'libusb-1.0.0-dev', 'libgtk-3-dev']
packages: ['clang-3.7', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
before_install:
- CFLAGS="$CFLAGS -m32"; CXXFLAGS="$CXXFLAGS -m32"; LDFLAGS="$LDFLAGS -m32";
- os: linux
dist: bionic
env: BADGE=linux
arch: x86
compiler: clang-6.0
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-bionic-6.0']
packages: ['clang-6.0', 'libusb-1.0.0-dev', 'libgtk-3-dev']
packages: ['clang-6.0', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
before_install:
- CFLAGS="$CFLAGS -m32"; CXXFLAGS="$CXXFLAGS -m32"; LDFLAGS="$LDFLAGS -m32";
- os: linux
dist: bionic
env: BADGE=linux
compiler: clang-9
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['clang-9', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
before_install:
- CFLAGS="$CFLAGS -m32"; CXXFLAGS="$CXXFLAGS -m32"; LDFLAGS="$LDFLAGS -m32";


### macOS ###
- os: osx
Expand All @@ -114,8 +127,14 @@ matrix:
- libusb
- gtk+3

### Windows ###
# - os: windows
# env: BADGE=windows
# compiler: gcc

script:
- git fetch --tags
- printenv
- cmake --version
- ./.travis.sh
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] || [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./.travis.sh; fi
# - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cmd.exe /C 'mingw64-build.bat'; fi
Loading