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_u_format_csv_gfxstream",
24    srcs: ["u_format.csv"],
25}
26
27python_binary_host {
28    name: "u_format_table_gen_gfxstream",
29    main: "u_format_table.py",
30    srcs: [
31        "u_format_table.py",
32        "u_format_pack.py",
33        "u_format_parse.py",
34    ],
35}
36
37genrule {
38    name: "u_format_pack_header_gfxstream",
39    srcs: [":libmesa_u_format_csv_gfxstream"],
40    out: ["u_format_pack.h"],
41    tools: ["u_format_table_gen_gfxstream"],
42    cmd: "python3 $(location u_format_table_gen_gfxstream) " +
43        "$(location :libmesa_u_format_csv_gfxstream) --header" +
44        "&> $(location u_format_pack.h)",
45}
46
47genrule {
48    name: "u_format_table_impl_gfxstream",
49    srcs: [":libmesa_u_format_csv_gfxstream"],
50    out: ["u_format_table.c"],
51    tools: ["u_format_table_gen_gfxstream"],
52    cmd: "python3 $(location u_format_table_gen_gfxstream) " +
53        "$(location :libmesa_u_format_csv_gfxstream) " +
54        "&> $(location u_format_table.c)",
55}
56
57cc_library_static {
58    name: "libmesa_util_format_gfxstream",
59    host_supported: true,
60    vendor: true,
61    defaults: [
62        "mesa_common_defaults_gfxstream",
63    ],
64    header_libs: [
65        "mesa_common_headers_gfxstream",
66        "libmesa_util_headers_gfxstream",
67    ],
68    generated_headers: [
69        "u_format_pack_header_gfxstream",
70    ],
71    generated_sources: [
72        "u_format_table_impl_gfxstream",
73        "format_srgb_impl_gfxstream",
74    ],
75    srcs: [
76        "u_format.c",
77        "u_format_bptc.c",
78        "u_format_etc.c",
79        "u_format_fxt1.c",
80        "u_format_latc.c",
81        "u_format_other.c",
82        "u_format_rgtc.c",
83        "u_format_s3tc.c",
84        "u_format_tests.c",
85        "u_format_unpack_neon.c",
86        "u_format_yuv.c",
87        "u_format_zs.c",
88    ],
89}
90