Skip to content

Commit 4065d54

Browse files
authored
Merge pull request #10067 from hzeller/feature-20260407-warn-compdb
Warning about different compile db: check multiple directories.
2 parents 9fd7346 + d206b37 commit 4065d54

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

etc/bazel-make-compilation-db.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ cat >> compile_flags.txt <<EOF
7070
-DBUILD_GUI=true
7171
EOF
7272

73-
# If there are two styles of comp-dbs, tools might have issues. Warn user.
74-
if [ -r compile_commands.json ]; then
75-
printf "\n\033[1;31mSuggest to remove old compile_commands.json to not interfere with compile_flags.txt\033[0m\n\n"
76-
fi
73+
# If there are two styles of comp-dbs, tools might choose wrong one. Warn user.
74+
for f in compile_commands.json build/compile_commands.json ; do
75+
if [ -r "$f" ]; then
76+
printf "\n\033[1;31mSuggest to remove old %s to not interfere with compile_flags.txt\033[0m\n\n" "$f"
77+
fi
78+
done

0 commit comments

Comments
 (0)