-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen-build-cmds.sh
More file actions
executable file
·33 lines (23 loc) · 898 Bytes
/
Copy pathgen-build-cmds.sh
File metadata and controls
executable file
·33 lines (23 loc) · 898 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
#!/usr/bin/env bash
set -euo pipefail
USER_CONFIG="${1:-Debug}"
MAKE_CONFIG="$(printf '%s' "$USER_CONFIG" | tr '[:upper:]' '[:lower:]')"
BUILD_DIR="build/linux-clang"
echo "==> Using make configuration: $MAKE_CONFIG"
echo "==> Running premake5 gmake-clang"
premake5 gmake-clang
echo "==> Entering ${BUILD_DIR}"
pushd "${BUILD_DIR}" > /dev/null
echo "==> Cleaning previous build"
make clean config="${MAKE_CONFIG}" 2>/dev/null || true
echo "==> Running bear with make (config=${MAKE_CONFIG})"
bear -- make config="${MAKE_CONFIG}" -j"$(nproc)"
popd > /dev/null
if [[ -f "${BUILD_DIR}/compile_commands.json" ]]; then
echo "==> Linking compile_commands.json to project root"
ln -sf "${BUILD_DIR}/compile_commands.json" compile_commands.json
echo "Done. clangd should now see all include paths."
else
echo "ERROR: compile_commands.json not found in ${BUILD_DIR}"
exit 1
fi