forked from sonyxperiadev/qti-headers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kernel_headers.go
38 lines (31 loc) · 892 Bytes
/
kernel_headers.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
package qti_kernel_headers
import (
"android/soong/android"
"android/soong/cc"
"fmt"
)
func init() {
// Register our own module type
android.RegisterModuleType("qti_kernel_headers_defaults", qtiKernelHeadersDefaultsFactory)
}
func qtiKernelHeadersDefaultsFactory() android.Module {
module := cc.DefaultsFactory()
// When the module is loaded, execute qtiKernelHeadersDefaults
android.AddLoadHook(module, qtiKernelHeadersDefaults)
return module
}
func qtiKernelHeadersDefaults(ctx android.LoadHookContext) {
config := ctx.Config().VendorConfig("qti_kernel_headers")
if config.IsSet("version") {
version := config.String("version")
qtimodule := fmt.Sprintf("qti_kernel_headers_%s", version)
p := struct {
Export_header_lib_headers []string
Header_libs []string
}{
[]string{qtimodule},
[]string{qtimodule},
}
ctx.AppendProperties(&p)
}
}