xref: /aosp_15_r20/external/mesa3d/src/gfxstream/guest/platform/Android.bp (revision 6104692788411f58d303aa86923a9ff6ecaded22)
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: ["external_mesa3d_license"],
20}
21
22cc_library_static {
23    name: "mesa_platform_virtgpu",
24    defaults: [
25        "mesa_gfxstream_guest_cc_defaults",
26    ],
27    srcs: [
28        "VirtGpu.cpp",
29    ],
30    header_libs: [
31        "mesa_common_headers",
32    ],
33    static_libs: [
34        "mesa_util",
35    ],
36    shared_libs: [
37        "libdrm",
38    ],
39    export_include_dirs: [
40        "include",
41    ],
42    export_shared_lib_headers: [
43        "libdrm",
44    ],
45    cflags: [
46        "-Wno-missing-field-initializers",
47        "-fvisibility=default",
48        "-fstrict-aliasing",
49    ],
50    local_include_dirs: [
51        "include",
52    ],
53    target: {
54        android: {
55            srcs: [
56                "linux/LinuxVirtGpuBlob.cpp",
57                "linux/LinuxVirtGpuBlobMapping.cpp",
58                "linux/LinuxVirtGpuDevice.cpp",
59                "linux/LinuxSync.cpp",
60                "kumquat/VirtGpuKumquatStub.cpp",
61            ],
62            shared_libs: [
63                "libsync",
64            ],
65        },
66        host: {
67            header_libs: [
68                "virtgpu_kumquat_ffi_headers",
69            ],
70            srcs: [
71                "linux/LinuxVirtGpuBlob.cpp",
72                "linux/LinuxVirtGpuBlobMapping.cpp",
73                "linux/LinuxVirtGpuDevice.cpp",
74                "linux/LinuxSync.cpp",
75                "kumquat/VirtGpuKumquatBlob.cpp",
76                "kumquat/VirtGpuKumquatBlobMapping.cpp",
77                "kumquat/VirtGpuKumquatDevice.cpp",
78                "kumquat/VirtGpuKumquatSync.cpp",
79            ],
80            shared_libs: [
81                "libvirtgpu_kumquat_ffi",
82            ],
83        },
84    },
85}
86
87cc_defaults {
88    name: "mesa_platform_virtgpu_defaults",
89    static_libs: [
90        "mesa_platform_virtgpu",
91        "mesa_util",
92        "mesa_util_c11",
93    ],
94    target: {
95        host: {
96            shared_libs: [
97                "libvirtgpu_kumquat_ffi",
98            ],
99        },
100    },
101}
102