1package {
2    // See: http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // all of the 'license_kinds' from "frameworks_native_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Apache-2.0
7    default_applicable_licenses: ["frameworks_native_license"],
8}
9
10cc_defaults {
11    name: "gpuservice_defaults",
12    cflags: [
13        "-Wall",
14        "-Werror",
15        "-Wformat",
16        "-Wthread-safety",
17        "-Wunused",
18        "-Wunreachable-code",
19    ],
20}
21
22cc_defaults {
23    name: "libgpuservice_defaults",
24    defaults: [
25        "gpuservice_defaults",
26        "libgfxstats_deps",
27        "libgpumem_deps",
28        "libgpumemtracer_deps",
29        "libvkjson_deps",
30        "libvkprofiles_deps",
31    ],
32    cflags: [
33        "-DLOG_TAG=\"GpuService\"",
34    ],
35    shared_libs: [
36        "libbase",
37        "libbinder",
38        "libcutils",
39        "libgpuwork",
40        "libgraphicsenv",
41        "liblog",
42        "libutils",
43    ],
44    static_libs: [
45        "libgfxstats",
46        "libgpumem",
47        "libgpumemtracer",
48        "libserviceutils",
49        "libvkjson",
50        "libvkprofiles",
51    ],
52    export_static_lib_headers: [
53        "libserviceutils",
54    ],
55    export_shared_lib_headers: [
56        "libgraphicsenv",
57    ],
58}
59
60cc_defaults {
61    name: "libgpuservice_production_defaults",
62    defaults: ["libgpuservice_defaults"],
63    cflags: [
64        "-fvisibility=hidden",
65    ],
66    lto: {
67        thin: true,
68    },
69    whole_program_vtables: true, // Requires ThinLTO
70}
71
72filegroup {
73    name: "libgpuservice_sources",
74    srcs: [
75        "GpuService.cpp",
76    ],
77}
78
79cc_library_static {
80    name: "libgpuservice",
81    defaults: ["libgpuservice_production_defaults"],
82    export_include_dirs: ["include"],
83    srcs: [
84        ":libgpuservice_sources",
85    ],
86}
87
88cc_defaults {
89    name: "libgpuservice_binary",
90    defaults: ["gpuservice_defaults"],
91    shared_libs: [
92        "libbinder",
93        "libcutils",
94        "liblog",
95        "libutils",
96    ],
97    ldflags: ["-Wl,--export-dynamic"],
98}
99
100filegroup {
101    name: "gpuservice_binary_sources",
102    srcs: ["main_gpuservice.cpp"],
103}
104
105cc_binary {
106    name: "gpuservice",
107    defaults: [
108        "libgpuservice_binary",
109        "libgpuservice_production_defaults",
110    ],
111    init_rc: ["gpuservice.rc"],
112    required: [
113        "bpfloader",
114        "gpuMem.o",
115    ],
116    srcs: [":gpuservice_binary_sources"],
117    static_libs: [
118        "libgpuservice",
119    ],
120}
121