1/*
2 * Copyright (C) 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package {
18    // See: http://go/android-license-faq
19    default_applicable_licenses: ["hardware_google_gfxstream_license"],
20}
21
22filegroup {
23    name: "libmesa_drirc_gfxstream",
24    srcs: ["00-mesa-defaults.conf"],
25}
26
27python_binary_host {
28    name: "format_srgb_gen_gfxstream",
29    main: "format_srgb.py",
30    srcs: ["format_srgb.py"],
31}
32
33python_binary_host {
34    name: "driconf_static_gen_gfxstream",
35    main: "driconf_static.py",
36    srcs: ["driconf_static.py"],
37    libs: [
38        "mako",
39    ],
40}
41
42genrule {
43    name: "format_srgb_impl_gfxstream",
44    out: ["format_srgb.c"],
45    tools: ["format_srgb_gen_gfxstream"],
46    cmd: "python3 $(location format_srgb_gen_gfxstream) " +
47        "&> $(location format_srgb.c)",
48}
49
50genrule {
51    name: "driconf_static_header_gfxstream",
52    srcs: [":libmesa_drirc_gfxstream"],
53    out: ["driconf_static.h"],
54    tools: ["driconf_static_gen_gfxstream"],
55    cmd: "python3 $(location driconf_static_gen_gfxstream) " +
56        "$(location :libmesa_drirc_gfxstream) " +
57        "$(location driconf_static.h)",
58}
59
60cc_library_headers {
61    name: "libmesa_util_headers_gfxstream",
62    host_supported: true,
63    vendor_available: true,
64    export_include_dirs: [
65        ".",
66    ],
67}
68
69cc_library_static {
70    name: "libmesa_util_gfxstream",
71    host_supported: true,
72    vendor: true,
73    defaults: [
74        "mesa_common_defaults_gfxstream",
75    ],
76    generated_headers: [
77        "driconf_static_header_gfxstream",
78    ],
79    static_libs: [
80        "libmesa_util_c11_gfxstream",
81    ],
82    shared_libs: [
83        "liblog",
84        "libcutils",
85    ],
86    srcs: [
87        "anon_file.c",
88        "bitscan.c",
89        "blob.c",
90        "build_id.c",
91        "compress.c",
92        "crc32.c",
93        "dag.c",
94        "double.c",
95        "disk_cache.c",
96        "disk_cache_os.c",
97        "fast_idiv_by_const.c",
98        "fossilize_db.c",
99        "futex.c",
100        "half_float.c",
101        "hash_table.c",
102        "u_idalloc.c",
103        "log.c",
104        "memstream.c",
105        "mesa-sha1.c",
106        "mesa-blake3.c",
107        "os_time.c",
108        "os_file.c",
109        "os_memory_fd.c",
110        "os_misc.c",
111        "os_socket.c",
112        "perf/u_trace.c",
113        "u_process.c",
114        "u_qsort.cpp",
115        "rwlock.c",
116        "sha1/sha1.c",
117        "ralloc.c",
118        "rand_xor.c",
119        "rb_tree.c",
120        "register_allocate.c",
121        "rgtc.c",
122        "set.c",
123        "simple_mtx.c",
124        "slab.c",
125        "softfloat.c",
126        "sparse_array.c",
127        "string_buffer.c",
128        "strtod.c",
129        "u_atomic.c",
130        "u_call_once.c",
131        "u_dl.c",
132        "u_dynarray.c",
133        "u_hash_table.c",
134        "u_queue.c",
135        "u_thread.c",
136        "u_vector.c",
137        "u_math.c",
138        "u_mm.c",
139        "u_debug.c",
140        "u_debug_memory.c",
141        "u_cpu_detect.c",
142        "u_printf.c",
143        "u_worklist.c",
144        "vl_zscan_data.c",
145        "vma.c",
146        "mesa_cache_db.c",
147        "mesa_cache_db_multipart.c",
148        "xmlconfig.c",
149    ],
150    target: {
151        host: {
152            header_libs: [
153                "mesa_common_headers_gfxstream",
154            ],
155            cflags: [
156                "-DHAVE_PROGRAM_INVOCATION_NAME",
157            ],
158        },
159        android: {
160            header_libs: [
161                "mesa_common_headers_gfxstream",
162            ],
163            cflags: [
164                "-DHAVE_MEMFD_CREATE",
165            ],
166        },
167    },
168}
169