forked from stlink-org/stlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.sh
executable file
·71 lines (60 loc) · 2.98 KB
/
.travis.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
echo "-- C compilers available"
ls -1 /usr/bin/gcc*
ls -1 /usr/bin/clang*
ls -1 /usr/bin/scan-build*
echo "----"
echo "WORK DIR:$DIR"
DIR=$PWD
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