diff options
author | Colin Cross <ccross@android.com> | 2016-04-11 14:37:39 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2016-04-11 14:52:04 -0700 |
commit | 8141347295ed901c4647014c9a21e2b4ae138b38 (patch) | |
tree | 3c79d9499a31087a4b328a34d1a6bfaa2381d813 | |
parent | 852442957bf35e9dced80ec01d8a72da28743ea5 (diff) | |
download | build_soong-8141347295ed901c4647014c9a21e2b4ae138b38.tar.gz build_soong-8141347295ed901c4647014c9a21e2b4ae138b38.tar.bz2 build_soong-8141347295ed901c4647014c9a21e2b4ae138b38.zip |
Rename deps property to objs in cc_objects
The deps property is handled by blueprint, which doesn't give the
flexibilty of handling it within soong. Switch to using objs instead.
Change-Id: Ib8273546578b31b186a3cf1566e80a5eb11943b7
-rw-r--r-- | cc/cc.go | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -175,7 +175,7 @@ type Deps struct { SharedLibs, LateSharedLibs []string StaticLibs, LateStaticLibs, WholeStaticLibs []string - ObjFiles common.Paths + ObjFiles []string Cflags, ReexportedCflags []string @@ -380,6 +380,11 @@ type TestLinkerProperties struct { Test_per_src *bool } +type ObjectLinkerProperties struct { + // names of other cc_object modules to link into this module using partial linking + Objs []string `android:"arch_variant"` +} + // Properties used to compile all C or C++ modules type BaseProperties struct { // compile module with clang instead of gcc @@ -722,7 +727,8 @@ func (c *Module) depsMutator(actx common.AndroidBottomUpMutatorContext) { sharedLibs = append(sharedLibs, c.deps.LateSharedLibs...) actx.AddVariationDependencies([]blueprint.Variation{{"link", "shared"}}, sharedLibs...) - actx.AddDependency(ctx.module(), c.deps.ObjFiles.Strings()...) + actx.AddDependency(ctx.module(), c.deps.ObjFiles...) + if c.deps.CrtBegin != "" { actx.AddDependency(ctx.module(), c.deps.CrtBegin) } @@ -1542,6 +1548,7 @@ func libraryFactory() (blueprint.Module, []interface{}) { // type objectLinker struct { + Properties ObjectLinkerProperties } func objectFactory() (blueprint.Module, []interface{}) { @@ -1551,14 +1558,14 @@ func objectFactory() (blueprint.Module, []interface{}) { return module.Init() } -func (*objectLinker) props() []interface{} { - return nil +func (object *objectLinker) props() []interface{} { + return []interface{}{&object.Properties} } func (*objectLinker) begin(ctx BaseModuleContext) {} -func (*objectLinker) deps(ctx BaseModuleContext, deps Deps) Deps { - // object files can't have any dynamic dependencies +func (object *objectLinker) deps(ctx BaseModuleContext, deps Deps) Deps { + deps.ObjFiles = append(deps.ObjFiles, object.Properties.Objs...) return deps } |