1package {
2    default_applicable_licenses: ["Android-Apache-2.0"],
3}
4
5soong_config_module_type {
6    name: "gralloc_defaults",
7    module_type: "cc_defaults",
8    config_namespace: "pixel_gralloc",
9    variables: [
10        "mapper_version",
11    ],
12    properties: [
13        "cflags",
14    ],
15}
16
17soong_config_string_variable {
18    name: "mapper_version",
19    values: [
20        "mapper4",
21        "mapper5",
22    ],
23}
24
25gralloc_defaults {
26    name: "mapper-version-defaults",
27    soong_config_variables: {
28        mapper_version: {
29            mapper5: {
30                cflags: [
31                    "-DMAPPER_5",
32                ],
33            },
34            mapper4: {
35                cflags: [
36                    "-DMAPPER_4",
37                ],
38            },
39        },
40    },
41}
42
43cc_defaults {
44    name: "pixel-gralloc-headers-dependencies",
45    defaults: [
46        "android.hardware.graphics.common-ndk_shared",
47        "mapper-version-defaults",
48    ],
49    shared_libs: [
50        "[email protected]",
51        "libgralloctypes",
52        "libvndksupport",
53    ],
54    header_libs: [
55        "libimapper_stablec",
56        "libimapper_providerutils",
57    ],
58}
59
60cc_library_headers {
61    name: "pixel-gralloc-headers",
62    // TODO(270442578): Change to vendor: true
63    vendor_available: true,
64    defaults: [
65        "pixel-gralloc-headers-dependencies",
66        "mapper-version-defaults",
67    ],
68    export_include_dirs: [
69        ".",
70    ],
71    visibility: [
72        "//visibility:public",
73    ],
74    // should be platform available since this header is used in lib_aion_buffer which is platform-available
75    apex_available: [
76        "//apex_available:platform",
77        "//apex_available:anyapex",
78    ],
79
80}
81