forked from KxSystems/protobufkdb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
travis_setup.sh
28 lines (25 loc) · 915 Bytes
/
travis_setup.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
#!/bin/bash
mkdir cbuild
# Download the protobuf c++ source code
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.12.3/protobuf-cpp-3.12.3.tar.gz
tar xvf protobuf-cpp-3.12.3.tar.gz -C ./cbuild --strip-components=1
if [[ "$TRAVIS_OS_NAME" == "osx" || "$TRAVIS_OS_NAME" == "linux" ]]; then
# Build and install protobuf to cbuild/install
cd cbuild
mkdir install
./configure --prefix=$(pwd)/install "CFLAGS=-fPIC" "CXXFLAGS=-fPIC"
make
sudo make install
cd ..
elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
# Build and install protobuf to cbuild/install
mkdir cbuild/install
mkdir cbuild/cmake/solution
cd cbuild/cmake/solution
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=../../install ..
cmake --build . --config Release
cmake --build . --config Release --target install
cd ../../..
else
echo "$TRAVIS_OS_NAME is currently not supported"
fi