Merge "Pass exportedFlags directly to Make"
This commit is contained in:
@@ -77,23 +77,18 @@ func (c *Module) AndroidMk() (ret android.AndroidMkData, err error) {
|
|||||||
return ret, nil
|
return ret, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (library *libraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
func (library *libraryDecorator) androidMkWriteExportedFlags(w io.Writer) {
|
||||||
writeExportedIncludes := func(w io.Writer) {
|
exportedFlags := library.exportedFlags()
|
||||||
var exportedIncludes []string
|
if len(exportedFlags) > 0 {
|
||||||
for _, flag := range library.exportedFlags() {
|
fmt.Fprintln(w, "LOCAL_EXPORT_CFLAGS :=", strings.Join(exportedFlags, " "))
|
||||||
if strings.HasPrefix(flag, "-I") {
|
|
||||||
exportedIncludes = append(exportedIncludes, strings.TrimPrefix(flag, "-I"))
|
|
||||||
}
|
}
|
||||||
}
|
exportedFlagsDeps := library.exportedFlagsDeps()
|
||||||
if len(exportedIncludes) > 0 {
|
if len(exportedFlagsDeps) > 0 {
|
||||||
fmt.Fprintln(w, "LOCAL_EXPORT_C_INCLUDE_DIRS :=", strings.Join(exportedIncludes, " "))
|
fmt.Fprintln(w, "LOCAL_EXPORT_C_INCLUDE_DEPS :=", strings.Join(exportedFlagsDeps.Strings(), " "))
|
||||||
}
|
|
||||||
exportedIncludeDeps := library.exportedFlagsDeps()
|
|
||||||
if len(exportedIncludeDeps) > 0 {
|
|
||||||
fmt.Fprintln(w, "LOCAL_EXPORT_C_INCLUDE_DEPS :=", strings.Join(exportedIncludeDeps.Strings(), " "))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (library *libraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||||
if library.static() {
|
if library.static() {
|
||||||
ret.Class = "STATIC_LIBRARIES"
|
ret.Class = "STATIC_LIBRARIES"
|
||||||
} else if library.shared() {
|
} else if library.shared() {
|
||||||
@@ -125,7 +120,7 @@ func (library *libraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.An
|
|||||||
fmt.Fprintln(w, "LOCAL_IS_HOST_MODULE := true")
|
fmt.Fprintln(w, "LOCAL_IS_HOST_MODULE := true")
|
||||||
}
|
}
|
||||||
|
|
||||||
writeExportedIncludes(w)
|
library.androidMkWriteExportedFlags(w)
|
||||||
fmt.Fprintln(w, "include $(BUILD_HEADER_LIBRARY)")
|
fmt.Fprintln(w, "include $(BUILD_HEADER_LIBRARY)")
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@@ -135,7 +130,7 @@ func (library *libraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.An
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
|
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
|
||||||
writeExportedIncludes(w)
|
library.androidMkWriteExportedFlags(w)
|
||||||
|
|
||||||
fmt.Fprintln(w, "LOCAL_BUILT_MODULE_STEM := $(LOCAL_MODULE)"+outputFile.Ext())
|
fmt.Fprintln(w, "LOCAL_BUILT_MODULE_STEM := $(LOCAL_MODULE)"+outputFile.Ext())
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user