Change bool, and string properties to *bool, and *string for cc
there's no use case for prepending/appending to bool, and string
properties within module struct. Declearing "*bool" and "*string" almost
cover everything user need.
I did see one case that user specify relative_install_path as
path prefix in cc_defaults, and concatenate with the one in real module
to get the final relative install path in Android.bp <bionic/tests/libs>.
Test: m -j checkbuild
Bug: b/68853585
Change-Id: If3a7a2689c3fc307aae136af6bc9c57f27a1e1a0
diff --git a/cc/androidmk.go b/cc/androidmk.go
index 194faab..065d0aa 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -64,8 +64,9 @@
if len(c.Properties.AndroidMkSharedLibs) > 0 {
fmt.Fprintln(w, "LOCAL_SHARED_LIBRARIES := "+strings.Join(c.Properties.AndroidMkSharedLibs, " "))
}
- if c.Target().Os == android.Android && c.Properties.Sdk_version != "" && !c.useVndk() {
- fmt.Fprintln(w, "LOCAL_SDK_VERSION := "+c.Properties.Sdk_version)
+ if c.Target().Os == android.Android &&
+ String(c.Properties.Sdk_version) != "" && !c.useVndk() {
+ fmt.Fprintln(w, "LOCAL_SDK_VERSION := "+String(c.Properties.Sdk_version))
fmt.Fprintln(w, "LOCAL_NDK_STL_VARIANT := none")
} else {
// These are already included in LOCAL_SHARED_LIBRARIES
@@ -244,7 +245,7 @@
ctx.subAndroidMk(ret, test.binaryDecorator)
ret.Class = "NATIVE_TESTS"
if Bool(test.Properties.Test_per_src) {
- ret.SubName = "_" + test.binaryDecorator.Properties.Stem
+ ret.SubName = "_" + String(test.binaryDecorator.Properties.Stem)
}
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) {
@@ -276,9 +277,10 @@
}
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) {
- if stripper.StripProperties.Strip.None {
+ if Bool(stripper.StripProperties.Strip.None) {
+
fmt.Fprintln(w, "LOCAL_STRIP_MODULE := false")
- } else if stripper.StripProperties.Strip.Keep_symbols {
+ } else if Bool(stripper.StripProperties.Strip.Keep_symbols) {
fmt.Fprintln(w, "LOCAL_STRIP_MODULE := keep_symbols")
} else {
fmt.Fprintln(w, "LOCAL_STRIP_MODULE := mini-debug-info")