42 lines
1008 B
Go
42 lines
1008 B
Go
package frameworkBluetooth
|
|
|
|
import (
|
|
"android/soong/android"
|
|
"android/soong/cc"
|
|
)
|
|
|
|
func init() {
|
|
android.RegisterModuleType("frameworkBluetooth_cc_library", frameworkBluetoothDefaultsFactory)
|
|
}
|
|
|
|
func frameworkBluetoothDefaultsFactory() (android.Module) {
|
|
module := cc.LibrarySharedFactory()
|
|
android.AddLoadHook(module, frameworkBluetoothHook)
|
|
return module
|
|
}
|
|
|
|
func frameworkBluetoothHook(ctx android.LoadHookContext) {
|
|
//AConfig() function is at build/soong/android/config.go
|
|
|
|
Version := ctx.AConfig().PlatformVersionName()
|
|
|
|
type props struct {
|
|
Srcs []string
|
|
Static_libs []string
|
|
Shared_libs []string
|
|
Cflags []string
|
|
}
|
|
|
|
p := &props{}
|
|
|
|
if (Version == "12") {
|
|
p.Cflags = append(p.Cflags, "-DANDROID_12")
|
|
} else if (Version == "14") {
|
|
p.Cflags = append(p.Cflags, "-DANDROID_14")
|
|
} else if (Version == "15") {
|
|
p.Cflags = append(p.Cflags, "-DANDROID_15")
|
|
}
|
|
|
|
ctx.AppendProperties(p)
|
|
}
|