forked from pact-foundation/pact-reference
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci-build.sh
executable file
·61 lines (52 loc) · 1.27 KB
/
ci-build.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
#!/bin/bash
set -e
set -x
rustc --version
cargo install --force cbindgen
rm -rf ./include
echo -------------------------------------
echo - Build library with CMake
echo -------------------------------------
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build . -v
cd ..
echo -------------------------------------
echo - Generate header with cbindgen
echo -------------------------------------
rustup run nightly cbindgen \
--config cbindgen.toml \
--crate pact_ffi \
--output include/pact.h
rustup run nightly cbindgen \
--config cbindgen-c++.toml \
--crate pact_ffi \
--output include/pact-c++.h
echo -------------------------------------
echo - Make library available for examples
echo -------------------------------------
cd build
cmake --install . --prefix ./install
echo -------------------------------------
echo - Running examples
echo -------------------------------------
cd ..
for i in examples/*; do
pushd $i
mkdir -p build
cd build
cmake ..
cmake --build .
echo "Running example $i"
if [[ "$OSTYPE" == "msys"* ]]; then
cp ../../../build/install/lib/*.dll Debug/
./Debug/example.exe
elif [[ "$OSTYPE" == "darwin"* ]]; then
cp ../../../build/install/lib/*.dylib .
./example
else
./example
fi
popd
done