diff options
| author | 2024-06-14 03:08:08 +0000 | |
|---|---|---|
| committer | 2024-06-14 03:08:08 +0000 | |
| commit | 0f81d852783f49a748dc3435345880df9268669c (patch) | |
| tree | 20e1c1f4ea11557f2f97a9359ec020633f7591b4 /rust/bindgen.go | |
| parent | 4c8f885b847330af8aa03bd4a7fb7a2191665470 (diff) | |
| parent | 1b0d92919d7924a64732e9a08f7ea6acf3b5aec1 (diff) | |
Merge "Make the cflags property configurable" into main am: 1b0d92919d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3131289
Change-Id: I56760a2763d6d41d82696d0286085c95d09dfa8d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'rust/bindgen.go')
| -rw-r--r-- | rust/bindgen.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rust/bindgen.go b/rust/bindgen.go index 427775351..83a6e9590 100644 --- a/rust/bindgen.go +++ b/rust/bindgen.go @@ -236,7 +236,8 @@ func (b *bindgenDecorator) GenerateSource(ctx ModuleContext, deps PathDeps) andr esc := proptools.NinjaAndShellEscapeList // Filter out invalid cflags - for _, flag := range b.ClangProperties.Cflags { + cflagsProp := b.ClangProperties.Cflags.GetOrDefault(ctx, nil) + for _, flag := range cflagsProp { if flag == "-x c++" || flag == "-xc++" { ctx.PropertyErrorf("cflags", "-x c++ should not be specified in cflags; setting cpp_std specifies this is a C++ header, or change the file extension to '.hpp' or '.hh'") @@ -248,7 +249,7 @@ func (b *bindgenDecorator) GenerateSource(ctx ModuleContext, deps PathDeps) andr } // Module defined clang flags and include paths - cflags = append(cflags, esc(b.ClangProperties.Cflags)...) + cflags = append(cflags, esc(cflagsProp)...) for _, include := range b.ClangProperties.Local_include_dirs { cflags = append(cflags, "-I"+android.PathForModuleSrc(ctx, include).String()) implicits = append(implicits, android.PathForModuleSrc(ctx, include)) |