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