Merge "Pass exportedFlags directly to Make"
This commit is contained in:
commit
f3d98fbb59
1 changed files with 12 additions and 17 deletions
|
@ -77,23 +77,18 @@ func (c *Module) AndroidMk() (ret android.AndroidMkData, err error) {
|
|||
return ret, nil
|
||||
}
|
||||
|
||||
func (library *libraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||
writeExportedIncludes := func(w io.Writer) {
|
||||
var exportedIncludes []string
|
||||
for _, flag := range library.exportedFlags() {
|
||||
if strings.HasPrefix(flag, "-I") {
|
||||
exportedIncludes = append(exportedIncludes, strings.TrimPrefix(flag, "-I"))
|
||||
}
|
||||
}
|
||||
if len(exportedIncludes) > 0 {
|
||||
fmt.Fprintln(w, "LOCAL_EXPORT_C_INCLUDE_DIRS :=", strings.Join(exportedIncludes, " "))
|
||||
}
|
||||
exportedIncludeDeps := library.exportedFlagsDeps()
|
||||
if len(exportedIncludeDeps) > 0 {
|
||||
fmt.Fprintln(w, "LOCAL_EXPORT_C_INCLUDE_DEPS :=", strings.Join(exportedIncludeDeps.Strings(), " "))
|
||||
}
|
||||
func (library *libraryDecorator) androidMkWriteExportedFlags(w io.Writer) {
|
||||
exportedFlags := library.exportedFlags()
|
||||
if len(exportedFlags) > 0 {
|
||||
fmt.Fprintln(w, "LOCAL_EXPORT_CFLAGS :=", strings.Join(exportedFlags, " "))
|
||||
}
|
||||
exportedFlagsDeps := library.exportedFlagsDeps()
|
||||
if len(exportedFlagsDeps) > 0 {
|
||||
fmt.Fprintln(w, "LOCAL_EXPORT_C_INCLUDE_DEPS :=", strings.Join(exportedFlagsDeps.Strings(), " "))
|
||||
}
|
||||
}
|
||||
|
||||
func (library *libraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||
if library.static() {
|
||||
ret.Class = "STATIC_LIBRARIES"
|
||||
} 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")
|
||||
}
|
||||
|
||||
writeExportedIncludes(w)
|
||||
library.androidMkWriteExportedFlags(w)
|
||||
fmt.Fprintln(w, "include $(BUILD_HEADER_LIBRARY)")
|
||||
|
||||
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 {
|
||||
writeExportedIncludes(w)
|
||||
library.androidMkWriteExportedFlags(w)
|
||||
|
||||
fmt.Fprintln(w, "LOCAL_BUILT_MODULE_STEM := $(LOCAL_MODULE)"+outputFile.Ext())
|
||||
|
||||
|
|
Loading…
Reference in a new issue