forked from hytech-racing/drivebrain_software_2026
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_script.sh
More file actions
executable file
·52 lines (39 loc) · 919 Bytes
/
Copy pathbuild_script.sh
File metadata and controls
executable file
·52 lines (39 loc) · 919 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env sh
set -e
profile="rpi_profile"
build_folder="build-arm"
if [ "$1" = "--test" ]; then
profile="default"
build_folder="build-native"
fi
rm -rf .venv
# rm -rf "$build_folder"
rm -rf cmake
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
# let cmake infer this
unset CC
unset CXX
unset CMAKE_TOOLCHAIN_FILE
conan profile detect --force
conan install . \
--build=missing \
--profile:build=default \
--profile:host="$profile" \
-of=cmake
mkdir -p "$build_folder"
cd "$build_folder"
. ../cmake/conanbuild.sh
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=../cmake/conan_toolchain.cmake \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_EXE_LINKER_FLAGS="-static" \
make -j
# run unit tests
if [ "$1" = "--test" ]; then
ctest --rerun-failed --output-on-failure
fi
cd ..
ln -sf "$build_folder"/compile_commands.json compile_commands.json