diff options
author | Dan Willemsen <dwillemsen@google.com> | 2015-06-22 15:40:14 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2015-06-22 16:00:08 -0700 |
commit | 1d9f279a80a19fde9445a7dbcbad2ae9469493cd (patch) | |
tree | fb487d0b210fe532a3499f9c7d143595cde7c28e /androidbp | |
parent | ff3b795effe72754d45aac57dc37bc8973a816de (diff) | |
download | build_soong-1d9f279a80a19fde9445a7dbcbad2ae9469493cd.tar.gz build_soong-1d9f279a80a19fde9445a7dbcbad2ae9469493cd.tar.bz2 build_soong-1d9f279a80a19fde9445a7dbcbad2ae9469493cd.zip |
androidbp: Add static_executable, fix suffix
Add a conversion for static_executable -> LOCAL_FORCE_STATIC_EXECUTABLE
In androidmk, LOCAL_MODULE_STEM values are converted to 'suffix' values
if it is in the form $(LOCAL_MODULE)<suffix>. Do the opposite in
androidbp.
Change-Id: Ia645cf21c0def3d055188ab5b021344bb50aa58e
Diffstat (limited to 'androidbp')
-rw-r--r-- | androidbp/cmd/androidbp.go | 9 | ||||
-rw-r--r-- | androidbp/cmd/soong.go | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/androidbp/cmd/androidbp.go b/androidbp/cmd/androidbp.go index ba2eda49..386e52c5 100644 --- a/androidbp/cmd/androidbp.go +++ b/androidbp/cmd/androidbp.go @@ -178,6 +178,15 @@ func prependLocalPath(name string, prop *bpparser.Property, suffix *string) (com } } +func prependLocalModule(name string, prop *bpparser.Property, suffix *string) (computedProps []string) { + if suffix != nil { + name += "_" + *suffix + } + return []string { + fmt.Sprintf("%s := $(LOCAL_MODULE)%s\n", name, valueToString(prop)), + } +} + func (w *androidMkWriter) lookupMap(parent bpparser.Value) (mapValue []*bpparser.Property) { if parent.Variable != "" { mapValue = w.mapScope[parent.Variable] diff --git a/androidbp/cmd/soong.go b/androidbp/cmd/soong.go index c40b5079..dda88ccf 100644 --- a/androidbp/cmd/soong.go +++ b/androidbp/cmd/soong.go @@ -19,7 +19,6 @@ var standardProperties = map[string]struct { "manifest": {"LOCAL_JAR_MANIFEST", bpparser.String}, "jarjar_rules": {"LOCAL_JARJAR_RULES", bpparser.String}, "certificate": {"LOCAL_CERTIFICATE", bpparser.String}, - "suffix": {"LOCAL_MODULE_SUFFIX", bpparser.String}, //"name": "LOCAL_PACKAGE_NAME", TODO // ==== LIST PROPERTIES ==== @@ -60,6 +59,7 @@ var standardProperties = map[string]struct { "rtti": {"LOCAL_RTTI_FLAG", bpparser.Bool}, "no_standard_libraries": {"LOCAL_NO_STANDARD_LIBRARIES", bpparser.Bool}, "export_package_resources": {"LOCAL_EXPORT_PACKAGE_RESOURCES", bpparser.Bool}, + "static_executable": {"LOCAL_FORCE_STATIC_EXECUTABLE", bpparser.Bool}, } var rewriteProperties = map[string]struct { @@ -68,6 +68,7 @@ var rewriteProperties = map[string]struct { }{ "local_include_dirs": {"LOCAL_C_INCLUDES", prependLocalPath}, "export_include_dirs": {"LOCAL_EXPORT_C_INCLUDE_DIRS", prependLocalPath}, + "suffix": {"LOCAL_MODULE_STEM", prependLocalModule}, } var moduleTypeToRule = map[string]string{ |