-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·29 lines (25 loc) · 822 Bytes
/
build.sh
File metadata and controls
executable file
·29 lines (25 loc) · 822 Bytes
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
#!/bin/bash
if [ -z ${COMPILE_ENGINE+x} ]; then
COMPILE_ENGINE=1
fi
if [ -z ${COMPILE_TEST_PLUGIN+x} ]; then
COMPILE_TEST_PLUGIN=1
fi
# tempor build
if [[ COMPILE_ENGINE -eq 1 ]]; then
cmake -DCMAKE_BUILD_TYPE=Debug -B build/tempor -S . -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=test || exit 1
fi
# test plugin build
if [[ COMPILE_TEST_PLUGIN -eq 1 ]]; then
cmake -DCMAKE_BUILD_TYPE=Debug -B build/plugins/test -S plugins/test/ -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=test || exit 1
fi
# generating final compile_commands.json
{
SEARCH_DIR="."
OUTPUT="build/compile_commands.json"
FILES=$(find "$SEARCH_DIR" -name compile_commands.json)
echo "[]" > "$OUTPUT"
for f in $FILES; do
jq -s '.[0] + .[1]' "$OUTPUT" "$f" > "$OUTPUT.tmp" && mv "$OUTPUT.tmp" "$OUTPUT"
done
}