1//
2// Copyright (C) 2018 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    default_applicable_licenses: ["external_virglrenderer_license"],
19}
20
21// Added automatically by a large-scale-change that took the approach of
22// 'apply every license found to every target'. While this makes sure we respect
23// every license restriction, it may not be entirely correct.
24//
25// e.g. GPL in an MIT project might only apply to the contrib/ directory.
26//
27// Please consider splitting the single license below into multiple licenses,
28// taking care not to lose any license_kind information, and overriding the
29// default license using the 'licenses: [...]' property on targets as needed.
30//
31// For unused files, consider creating a 'fileGroup' with "//visibility:private"
32// to attach the license to, and including a comment whether the files may be
33// used in the current project.
34//
35// large-scale-change included anything that looked like it might be a license
36// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
37//
38// Please consider removing redundant or irrelevant files from 'license_text:'.
39// See: http://go/android-license-faq
40license {
41    name: "external_virglrenderer_license",
42    visibility: [":__subpackages__"],
43    license_kinds: [
44        "SPDX-license-identifier-BSD",
45        "SPDX-license-identifier-BSL-1.0",
46        "SPDX-license-identifier-MIT",
47    ],
48    license_text: [
49        "COPYING",
50        "LICENSE",
51        "NOTICE",
52    ],
53}
54
55cc_library_headers {
56  name: "virgl_headers",
57  host_supported: true,
58  export_include_dirs: ["src"],
59}
60
61cc_library {
62    name: "libvirglrenderer",
63    host_supported: true,
64    cflags: [
65        "-DHAVE_CONFIG_H",
66        "-Wno-null-pointer-arithmetic",
67        "-Wno-macro-redefined",
68        "-Wno-unused-function",
69        "-Wno-incompatible-pointer-types-discards-qualifiers",
70        "-Wno-unused-parameter",
71    ],
72    c_std: "experimental",
73    local_include_dirs: [
74        "prebuilt-intermediates",
75        "src",
76        "src/gallium/auxiliary",
77        "src/gallium/auxiliary/util",
78        "src/gallium/include",
79    ],
80    srcs: [
81        "prebuilt-intermediates/src/u_format_table.c",
82        "src/gallium/auxiliary/cso_cache/cso_cache.c",
83        "src/gallium/auxiliary/cso_cache/cso_hash.c",
84        "src/gallium/auxiliary/os/os_misc.c",
85        "src/gallium/auxiliary/tgsi/tgsi_build.c",
86        "src/gallium/auxiliary/tgsi/tgsi_dump.c",
87        "src/gallium/auxiliary/tgsi/tgsi_iterate.c",
88        "src/gallium/auxiliary/tgsi/tgsi_parse.c",
89        "src/gallium/auxiliary/tgsi/tgsi_sanity.c",
90        "src/gallium/auxiliary/tgsi/tgsi_scan.c",
91        "src/gallium/auxiliary/tgsi/tgsi_text.c",
92        "src/gallium/auxiliary/tgsi/tgsi_transform.c",
93        "src/gallium/auxiliary/tgsi/tgsi_info.c",
94        "src/gallium/auxiliary/tgsi/tgsi_strings.c",
95        "src/gallium/auxiliary/tgsi/tgsi_ureg.c",
96        "src/gallium/auxiliary/tgsi/tgsi_util.c",
97        "src/gallium/auxiliary/util/u_bitmask.c",
98        "src/gallium/auxiliary/util/u_cpu_detect.c",
99        "src/gallium/auxiliary/util/u_debug.c",
100        "src/gallium/auxiliary/util/u_debug_describe.c",
101        "src/gallium/auxiliary/util/u_format.c",
102        "src/gallium/auxiliary/util/u_hash_table.c",
103        "src/gallium/auxiliary/util/u_math.c",
104        "src/gallium/auxiliary/util/u_texture.c",
105        "src/gallium/auxiliary/util/u_surface.c",
106        "src/iov.c",
107        "src/virgl_context.c",
108        "src/virglrenderer.c",
109        "src/virgl_resource.c",
110        "src/virgl_util.c",
111        "src/vrend_blitter.c",
112        "src/vrend_debug.c",
113        "src/vrend_decode.c",
114        "src/vrend_formats.c",
115        "src/vrend_object.c",
116        "src/vrend_renderer.c",
117        "src/vrend_shader.c",
118        "src/vrend_tweaks.c",
119        "src/vrend_winsys.c",
120        "src/vrend_winsys_egl.c",
121        "src/vrend_winsys_gbm.c",
122    ],
123    target: {
124        linux_glibc: {
125            // Avoid linking to another host copy of libdrm; this library will cause
126            // binary GPU drivers to be loaded from the host, which might be linked
127            // to a system copy of libdrm, which conflicts with the AOSP one
128            allow_undefined_symbols: true,
129            header_libs: ["libdrm_headers"],
130            shared_libs: [
131                "libepoxy",
132                "libgbm"
133            ],
134        },
135        linux_bionic: {
136            shared_libs: [
137                "libdrm",
138                "libepoxy",
139                "libgbm",
140            ],
141        },
142        android: {
143            shared_libs: [
144                "libdrm",
145                "liblog",
146            ],
147            static_libs: [
148                "libepoxy",
149                "libgbm",
150            ],
151        },
152    },
153    apex_available: [
154        "//apex_available:platform",
155        "com.android.virt",
156    ],
157}
158