From da63a49338c1e9d95d5ba6f0074ffc778101d83d Mon Sep 17 00:00:00 2001 From: Inseob Kim Date: Mon, 10 Jun 2019 23:03:16 +0900 Subject: [PATCH] Fix sysprop_library build err when using filegroup .sysprop files are intended to be used only with sysprop_library, and we can prevent build error by specifying dependencies upon CreateModule. Bug: 131708148 Test: 1) try building sysprop_library module. Test: 2) see liblog is correctly linked. Change-Id: I702cedc255ee0b6a30c15e474dd6a88d9607b145 --- cc/compiler.go | 5 ----- sysprop/sysprop_library.go | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cc/compiler.go b/cc/compiler.go index 7667ae7ab..fd6184b3a 100644 --- a/cc/compiler.go +++ b/cc/compiler.go @@ -225,11 +225,6 @@ func (compiler *baseCompiler) compilerDeps(ctx DepsContext, deps Deps) Deps { deps = protoDeps(ctx, deps, &compiler.Proto, Bool(compiler.Properties.Proto.Static)) } - if compiler.hasSrcExt(".sysprop") { - deps.HeaderLibs = append(deps.HeaderLibs, "libbase_headers") - deps.SharedLibs = append(deps.SharedLibs, "liblog") - } - if Bool(compiler.Properties.Openmp) { deps.StaticLibs = append(deps.StaticLibs, "libomp") } diff --git a/sysprop/sysprop_library.go b/sysprop/sysprop_library.go index 3f2709e29..86061c6a2 100644 --- a/sysprop/sysprop_library.go +++ b/sysprop/sysprop_library.go @@ -123,6 +123,8 @@ func syspropLibraryHook(ctx android.LoadHookContext, m *syspropLibrary) { Sysprop struct { Platform *bool } + Header_libs []string + Shared_libs []string }{} ccProps.Name = proptools.StringPtr(m.CcModuleName()) @@ -130,6 +132,8 @@ func syspropLibraryHook(ctx android.LoadHookContext, m *syspropLibrary) { ccProps.Device_specific = proptools.BoolPtr(deviceSpecific) ccProps.Product_specific = proptools.BoolPtr(productSpecific) ccProps.Sysprop.Platform = proptools.BoolPtr(owner == "Platform") + ccProps.Header_libs = []string{"libbase_headers"} + ccProps.Shared_libs = []string{"liblog"} ctx.CreateModule(android.ModuleFactoryAdaptor(cc.LibraryFactory), &m.commonProperties, &ccProps) }