Signed-off-by: hmz007 <hmz007@gmail.com> Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
36 lines
964 B
Go
Executable File
36 lines
964 B
Go
Executable File
package hdmicec
|
|
import (
|
|
"android/soong/android"
|
|
"android/soong/cc"
|
|
// "fmt"
|
|
"strings"
|
|
)
|
|
func init() {
|
|
//fmt.Println("hdmicec module init start")
|
|
android.RegisterModuleType("hdmicec", DefaultsFactory)
|
|
}
|
|
func DefaultsFactory() (android.Module) {
|
|
module := cc.DefaultsFactory()
|
|
android.AddLoadHook(module, Defaults)
|
|
return module
|
|
}
|
|
func Defaults(ctx android.LoadHookContext) {
|
|
type props struct {
|
|
Cflags []string
|
|
}
|
|
p := &props{}
|
|
p.Cflags = globalDefaults(ctx)
|
|
ctx.AppendProperties(p)
|
|
}
|
|
func globalDefaults(ctx android.BaseContext) ([]string) {
|
|
var cppflags []string
|
|
// fmt.Println("HDMI_PORT_TYPE:",
|
|
// ctx.AConfig().Getenv("HDMI_PORT_TYPE"))
|
|
if strings.EqualFold(ctx.AConfig().Getenv("HDMI_PORT_TYPE"),"in") {
|
|
cppflags = append(cppflags,"-DHDMI_PORT_TYPE=in")
|
|
}else{
|
|
cppflags = append(cppflags,"-DHDMI_PORT_TYPE=out")
|
|
}
|
|
return cppflags
|
|
}
|