forked from open-vela/frameworks_bluetooth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathframeworkBluetooth.go
39 lines (30 loc) · 922 Bytes
/
frameworkBluetooth.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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")
}
ctx.AppendProperties(p)
}