Skip to content

Commit 45cc1f6

Browse files
authored
Merge pull request The-OpenROAD-Project#9506 from hzeller/feature-20260220-py-compdb
Tell compilation db where to find the Python.h includes.
2 parents f44fc7e + 9760cb0 commit 45cc1f6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

etc/bazel-make-compilation-db.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ done >> compile_flags.txt
4949
# Qt include files check for this
5050
echo '-fPIC' >> compile_flags.txt
5151

52+
# Python include bindings.
53+
for f in bazel-out/../../../external/*/include/python3.*/Python.h; do
54+
if [ -f "${f}" ]; then
55+
PY_INC="$(dirname "${f}")"
56+
echo "-I${PY_INC}"
57+
echo "-I$(realpath "${PY_INC}")" # work around clangd bug
58+
break
59+
fi
60+
done >> compile_flags.txt
61+
5262
# Since we don't do per-file define extraction in compile_flag.txt,
5363
# add them here globally
5464
cat >> compile_flags.txt <<EOF

0 commit comments

Comments
 (0)