summaryrefslogtreecommitdiff
path: root/cc/cc.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/cc.go')
-rw-r--r--cc/cc.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/cc/cc.go b/cc/cc.go
index 7237686e4..f4b565550 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -27,6 +27,7 @@ import (
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
+ "android/soong/aidl_library"
"android/soong/android"
"android/soong/bazel/cquery"
"android/soong/cc/config"
@@ -110,6 +111,9 @@ type Deps struct {
// Used by DepsMutator to pass system_shared_libs information to check_elf_file.py.
SystemSharedLibs []string
+ // Used by DepMutator to pass aidl_library modules to aidl compiler
+ AidlLibs []string
+
// If true, statically link the unwinder into native libraries/binaries.
StaticUnwinderIfLegacy bool
@@ -182,6 +186,9 @@ type PathDeps struct {
// For Darwin builds, the path to the second architecture's output that should
// be combined with this architectures's output into a FAT MachO file.
DarwinSecondArchOutput android.OptionalPath
+
+ // Paths to direct srcs and transitive include dirs from direct aidl_library deps
+ AidlLibraryInfos []aidl_library.AidlLibraryInfo
}
// LocalOrGlobalFlags contains flags that need to have values set globally by the build system or locally by the module
@@ -765,6 +772,7 @@ var (
stubImplDepTag = dependencyTag{name: "stub_impl"}
JniFuzzLibTag = dependencyTag{name: "jni_fuzz_lib_tag"}
FdoProfileTag = dependencyTag{name: "fdo_profile"}
+ aidlLibraryTag = dependencyTag{name: "aidl_library"}
)
func IsSharedDepTag(depTag blueprint.DependencyTag) bool {
@@ -2751,6 +2759,14 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) {
}
}
+ if len(deps.AidlLibs) > 0 {
+ actx.AddDependency(
+ c,
+ aidlLibraryTag,
+ deps.AidlLibs...,
+ )
+ }
+
updateImportedLibraryDependency(ctx)
}
@@ -3055,6 +3071,17 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
return
}
+ if depTag == aidlLibraryTag {
+ if ctx.OtherModuleHasProvider(dep, aidl_library.AidlLibraryProvider) {
+ depPaths.AidlLibraryInfos = append(
+ depPaths.AidlLibraryInfos,
+ ctx.OtherModuleProvider(
+ dep,
+ aidl_library.AidlLibraryProvider).(aidl_library.AidlLibraryInfo),
+ )
+ }
+ }
+
ccDep, ok := dep.(LinkableInterface)
if !ok {