• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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        "-include prebuilt-intermediates/config.h",
67        "-Wno-unused-parameter",
68    ],
69    local_include_dirs: [
70        "prebuilt-intermediates",
71        "src",
72        "src/drm",
73        "src/gallium/auxiliary",
74        "src/gallium/auxiliary/util",
75        "src/gallium/include",
76        "src/mesa",
77        "src/mesa/compat",
78        "src/mesa/pipe",
79        "src/mesa/util",
80        "src/venus",
81    ],
82    srcs: [
83        "prebuilt-intermediates/src/u_format_table.c",
84        "src/gallium/auxiliary/cso_cache/cso_cache.c",
85        "src/gallium/auxiliary/cso_cache/cso_hash.c",
86        "src/gallium/auxiliary/tgsi/tgsi_build.c",
87        "src/gallium/auxiliary/tgsi/tgsi_dump.c",
88        "src/gallium/auxiliary/tgsi/tgsi_info.c",
89        "src/gallium/auxiliary/tgsi/tgsi_iterate.c",
90        "src/gallium/auxiliary/tgsi/tgsi_parse.c",
91        "src/gallium/auxiliary/tgsi/tgsi_sanity.c",
92        "src/gallium/auxiliary/tgsi/tgsi_scan.c",
93        "src/gallium/auxiliary/tgsi/tgsi_strings.c",
94        "src/gallium/auxiliary/tgsi/tgsi_text.c",
95        "src/gallium/auxiliary/tgsi/tgsi_util.c",
96        "src/gallium/auxiliary/util/u_debug_describe.c",
97        "src/gallium/auxiliary/util/u_format.c",
98        "src/gallium/auxiliary/util/u_hash_table.c",
99        "src/gallium/auxiliary/util/u_texture.c",
100        "src/mesa/util/anon_file.c",
101        "src/mesa/util/bitscan.c",
102        "src/mesa/util/hash_table.c",
103        "src/mesa/util/os_file.c",
104        "src/mesa/util/os_misc.c",
105        "src/mesa/util/ralloc.c",
106        "src/mesa/util/u_cpu_detect.c",
107        "src/mesa/util/u_debug.c",
108        "src/mesa/util/u_math.c",
109        "src/iov.c",
110        "src/virgl_context.c",
111        "src/virglrenderer.c",
112        "src/virgl_resource.c",
113        "src/virgl_util.c",
114        "src/vrend_blitter.c",
115        "src/vrend_debug.c",
116        "src/vrend_decode.c",
117        "src/vrend_formats.c",
118        "src/vrend_object.c",
119        "src/vrend_renderer.c",
120        "src/vrend_shader.c",
121        "src/vrend_tweaks.c",
122        "src/vrend_winsys.c",
123        "src/vrend_winsys_egl.c",
124        "src/vrend_winsys_gbm.c",
125    ],
126    target: {
127        host_linux: {
128            shared_libs: [
129                "libdrm",
130                "libepoxy",
131                "libgbm",
132            ],
133        },
134        linux_glibc: {
135            cflags: [
136                "-Wno-#warnings",
137                // FIXME: Figure out how to get C protos for asprintf,
138                // pthread_setname_np and sched_getcpu from glibc sysroot
139                "-Wno-error=implicit-function-declaration",
140            ],
141            // Avoid linking to another host copy of libdrm; this library will cause
142            // binary GPU drivers to be loaded from the host, which might be linked
143            // to a system copy of libdrm, which conflicts with the AOSP one
144            allow_undefined_symbols: true,
145            header_libs: ["libdrm_headers"],
146            exclude_shared_libs: [
147                "libdrm",
148            ],
149        },
150        linux_bionic: {
151            cflags: [
152                // Provide a C proto for memfd_create
153                "-D__USE_GNU",
154                "-DHAVE_MEMFD_CREATE=1",
155            ],
156        },
157        android: {
158            cflags: [
159                // Provide a C proto for memfd_create
160                "-D__USE_GNU",
161                "-DHAVE_MEMFD_CREATE=1",
162            ],
163            shared_libs: [
164                "libcutils",
165                "liblog",
166            ],
167            static_libs: [
168                "libdrm",
169                "libepoxy",
170                "libgbm",
171            ],
172        },
173    },
174    apex_available: [
175        "//apex_available:platform",
176        "com.android.virt",
177    ],
178}
179