forked from ncblair/NTHN_TEMPLATE_PLUGIN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·56 lines (42 loc) · 1.22 KB
/
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
#!/bin/bash
python src/parameters/create_parameters.py
PLUGIN_NAME="EXAMPLE"
MODE="RelWithDebInfo"
if ! [ -d "build" ]; then
`mkdir -p build`
fi
# "./build.sh -m Debug", for example
while getopts "m:" flag
do
case "${flag}" in
m) MODE=${OPTARG};;
*)
echo "Invalid option: -${flag}" >&2
exit 1
;;
esac
done
ARCH=$(uname -m)
echo "=================
PLUGIN: ${PLUGIN_NAME}
MODE: ${MODE}
ARCHITECTURE: ${ARCH}
================"
cd build
if [ $ARCH = 'x86_64' ]; then
cmake -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_BUILD_TYPE="$MODE" ..
elif [ $ARCH = 'arm64' ]; then
cmake -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_BUILD_TYPE="$MODE" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 ..
fi
cd ..
cmake --build build -j8 --config ${MODE}
result=$?
if [ ${result} == 0 ]; then
say "Build successful"
# CHANGE THIS LINE TO OPEN A ... DAW, or a debugger if you want
# build/"$PLUGIN_NAME"_artefacts/"$MODE"/Standalone/"$PLUGIN_NAME".app/Contents/MacOS/"$PLUGIN_NAME"
# lldb /Applications/REAPER.app/Contents/MacOS/REAPER peripheral/Test.rpp
# /Applications/Ableton\ Live\ 11\ Suite.app/Contents/MacOS/Live peripheral/Test\ Project/Test.als
else
say "Build failed"
fi