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
This commit is contained in:
@@ -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]
|
||||
|
@@ -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{
|
||||
|
Reference in New Issue
Block a user