diff options
author | Dan Willemsen <dwillemsen@google.com> | 2018-03-12 15:30:26 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2018-04-17 10:34:23 -0700 |
commit | 050ca73dbfdd360a209daf93a6f7d059a8705569 (patch) | |
tree | 3332693a54c93fb13b220f44ea3a5ea7e171a65a /cc | |
parent | e9216117dd376aa48476c0ef448fcbd818961861 (diff) | |
download | build_soong-050ca73dbfdd360a209daf93a6f7d059a8705569.tar.gz build_soong-050ca73dbfdd360a209daf93a6f7d059a8705569.tar.bz2 build_soong-050ca73dbfdd360a209daf93a6f7d059a8705569.zip |
Use Config/DeviceConfig functions to access ProductVariables
An upcoming change will stop exporting ProductVariables from Config, so
switch to using existing accessor functions, and add more when they're
missing.
Bug: 76168832
Test: out/soong/build.ninja is identical
Change-Id: Ie0135bdbd2df3258ef3ddb53e5f8fc00aa9b97f7
Merged-In: Ie0135bdbd2df3258ef3ddb53e5f8fc00aa9b97f7
(cherry picked from commit 3fb1faeeb98143e132ca4d6f1cac42d6f060888b)
Diffstat (limited to 'cc')
-rw-r--r-- | cc/binary.go | 2 | ||||
-rw-r--r-- | cc/makevars.go | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/cc/binary.go b/cc/binary.go index c3e899a0..9e7b70b2 100644 --- a/cc/binary.go +++ b/cc/binary.go @@ -192,7 +192,7 @@ func (binary *binaryDecorator) linkerInit(ctx BaseModuleContext) { if !ctx.toolchain().Bionic() { if ctx.Os() == android.Linux { - if binary.Properties.Static_executable == nil && Bool(ctx.Config().ProductVariables.HostStaticBinaries) { + if binary.Properties.Static_executable == nil && ctx.Config().HostStaticBinaries() { binary.Properties.Static_executable = BoolPtr(true) } } else { diff --git a/cc/makevars.go b/cc/makevars.go index b87494e6..3bb00a1a 100644 --- a/cc/makevars.go +++ b/cc/makevars.go @@ -89,11 +89,7 @@ func makeVarsProvider(ctx android.MakeVarsContext) { ctx.Strict("GLOBAL_CLANG_CPPFLAGS_NO_OVERRIDE", "") ctx.Strict("NDK_PREBUILT_SHARED_LIBRARIES", strings.Join(ndkPrebuiltSharedLibs, " ")) - if ctx.Config().ProductVariables.DeviceVndkVersion != nil { - ctx.Strict("BOARD_VNDK_VERSION", *ctx.Config().ProductVariables.DeviceVndkVersion) - } else { - ctx.Strict("BOARD_VNDK_VERSION", "") - } + ctx.Strict("BOARD_VNDK_VERSION", ctx.DeviceConfig().VndkVersion()) ctx.Strict("VNDK_CORE_LIBRARIES", strings.Join(vndkCoreLibraries, " ")) ctx.Strict("VNDK_SAMEPROCESS_LIBRARIES", strings.Join(vndkSpLibraries, " ")) @@ -211,7 +207,7 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string, hod = "Device" } - if target.Os.Class == android.Host && Bool(ctx.Config().ProductVariables.HostStaticBinaries) { + if target.Os.Class == android.Host && ctx.Config().HostStaticBinaries() { productExtraLdflags += "-static" } |