-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-artifacts.sh
executable file
·75 lines (62 loc) · 1.98 KB
/
build-artifacts.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
72
73
74
#!/bin/bash
set -e
#git submodule init
#git submodule update
#pushd Sources/CAVDECC/avdecc
#git submodule init
#git submodule update
#popd
ARCH=`arch`
if [ "$ARCH" == "aarch64" ]; then
ARCH=arm64;
elif [ "$ARCH" == "x86_64" ]; then
ARCH=x64;
fi
PLATFORM=`uname`
if [ "$PLATFORM" == "Linux" ]; then
PLATFORM=linux;
elif [ "$PLATFORM" == "Darwin" ]; then
PLATFORM=mac;
fi
if [ "$PLATFORM" == "mac" ]; then
export PATH="$(brew --prefix grep)/libexec/gnubin:$(brew --prefix bash)/bin:$PATH"
ARCHS="-arch x64 -arch arm64"
CLANGDIR=
SOSUFFIX=dylib;
ARCH=x64_arm64;
CONFIG=release;
BUILDCFLAGS="-Wno-error=deprecated-declarations -fblocks";
BUILDLDFLAGS_SHARED="";
BUILDLDFLAGS_STATIC="";
else
ARCHS="-arch ${ARCH}"
CLANGDIR=/opt/swift
SOSUFFIX=so;
CONFIG=debug;
BUILDCFLAGS="-I${CLANGDIR}/usr/lib/swift -fblocks"
BUILDLDFLAGS_SHARED="-L${CLANGDIR}/usr/lib/swift/${PLATFORM} -Wl,-rpath,${CLANGDIR}/usr/lib/swift/${PLATFORM} -lBlocksRuntime"
BUILDLDFLAGS_STATIC="-Wl,-L${CLANGDIR}/usr/lib/swift_static/${PLATFORM} -lBlocksRuntime"
fi
# for macOS, build release as otherwise artifact bundle exceeds non-LFS GH size
BUILDDIR="_build_${PLATFORM}_${ARCH}_makefiles_${CONFIG}"
pushd Sources/CAVDECC/avdecc
echo "Build directory is $BUILDDIR with flags $BUILDFLAGS"
rm -rf $BUILDDIR
./gen_cmake.sh ${ARCHS} \
-a "-DCMAKE_C_COMPILER=${CLANGDIR}/usr/bin/clang" \
-a "-DCMAKE_C_FLAGS=${BUILDCFLAGS}" \
-a "-DCMAKE_CXX_COMPILER=${CLANGDIR}/usr/bin/clang++" \
-a "-DCMAKE_CXX_FLAGS=${BUILDCFLAGS}" \
-a "-DCMAKE_SHARED_LINKER_FLAGS=${BUILDLDFLAGS_SHARED}" \
-a "-DCMAKE_STATIC_LINKER_FLAGS=" \
-c "Unix Makefiles" \
"-${CONFIG}" \
-build-c
cp ../../../info.json.in info.json
pushd $BUILDDIR
make -j9
popd
zip --symlinks -r ../../../avdecc.artifactbundle.zip info.json include \
$BUILDDIR/src/controller/libla_avdecc_controller_cxx* \
$BUILDDIR/src/bindings/c/libla_avdecc_c* \
$BUILDDIR/src/libla_avdecc_cxx*