Skip to content

Commit

Permalink
Allowlist more clang flags in bindgen
Browse files Browse the repository at this point in the history
  • Loading branch information
hlopko committed Sep 26, 2024
1 parent 147886f commit 85ddc09
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion bindgen/private/bindgen.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,23 @@ def _rust_bindgen_impl(ctx):
# Ideally we could depend on a more specific toolchain, requesting one which is specifically clang via some constraint.
# Unfortunately, we can't currently rely on this, so instead we filter only to flags we know clang supports.
# We can add extra flags here as needed.
flags_known_to_clang = ("-I", "-iquote", "-isystem", "--sysroot", "--gcc-toolchain")
flags_known_to_clang = (
"-I",
"-iquote",
"-isystem",
"--sysroot",
"--gcc-toolchain",
"--target",
"-W",
"--system-header-prefix",
"--no-system-header-prefix",
"-Xclang",
"-D",
"-f",
"-m",
"-g",
"-no-canonical",
)
open_arg = False
for arg in compile_flags:
if open_arg:
Expand Down

0 comments on commit 85ddc09

Please sign in to comment.