diff options
author | 2024-09-16 20:08:13 +0000 | |
---|---|---|
committer | 2024-09-17 18:33:46 +0000 | |
commit | 3cc44de313908be78ee55e6b4e49f21bf1d5a630 (patch) | |
tree | fc452f091946cf22b24878f469244e1bcf37ce5f | |
parent | 4f1f049f5ca2a2038d04931aacb6a6c3eecf03eb (diff) |
Soong: libbpf_prog: add support for header_libs
Add header_libs support for libbpf_prog modules.
Test: TH / manual
Bug: 359646531
Change-Id: I9e705645582ec12bfa0a2e388d0049bb472456e3
Signed-off-by: Neill Kapron <nkapron@google.com>
-rw-r--r-- | bpf/libbpf/libbpf_prog.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bpf/libbpf/libbpf_prog.go b/bpf/libbpf/libbpf_prog.go index f9f64f57c..ac6151040 100644 --- a/bpf/libbpf/libbpf_prog.go +++ b/bpf/libbpf/libbpf_prog.go @@ -89,6 +89,8 @@ type LibbpfProgProperties struct { // be added to the include path using -I Local_include_dirs []string `android:"arch_variant"` + Header_libs []string `android:"arch_variant"` + // optional subdirectory under which this module is installed into. Relative_install_path string } @@ -141,6 +143,7 @@ func (libbpf *libbpfProg) SetImageVariation(ctx android.BaseModuleContext, varia func (libbpf *libbpfProg) DepsMutator(ctx android.BottomUpMutatorContext) { ctx.AddDependency(ctx.Module(), libbpfProgDepTag, "libbpf_headers") + ctx.AddVariationDependencies(nil, cc.HeaderDepTag(), libbpf.properties.Header_libs...) } func (libbpf *libbpfProg) GenerateAndroidBuildActions(ctx android.ModuleContext) { @@ -182,6 +185,11 @@ func (libbpf *libbpfProg) GenerateAndroidBuildActions(ctx android.ModuleContext) depName := ctx.OtherModuleName(dep) ctx.ModuleErrorf("module %q is not a genrule", depName) } + } else if depTag == cc.HeaderDepTag() { + depExporterInfo, _ := android.OtherModuleProvider(ctx, dep, cc.FlagExporterInfoProvider) + for _, dir := range depExporterInfo.IncludeDirs { + cflags = append(cflags, "-I "+dir.String()) + } } }) |