xref: /aosp_15_r20/external/mesa3d/src/gfxstream/guest/vulkan/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_shared {
23    name: "vulkan.ranchu",
24    defaults: [
25        "mesa_gfxstream_guest_cc_defaults",
26        "mesa_common_defaults",
27        "mesa_platform_virtgpu_defaults",
28    ],
29    generated_headers: [
30        "vk_cmd_queue_header",
31        "vk_physical_device_features_header",
32        "vk_physical_device_properties_header",
33        "spirv_info_header",
34    ],
35    header_libs: [
36        "mesa_compiler_headers",
37        "mesa_common_headers",
38        "libnativewindow_headers",
39        "mesa_vulkan_enc_headers",
40        "mesa_gfxstream_aemu_headers",
41    ],
42    static_libs: [
43        "mesa_compiler",
44        "mesa_util_c11",
45        "mesa_vulkan_util",
46        "mesa_vulkan_runtime",
47        "mesa_vulkan_wsi",
48        "mesa_gfxstream_vulkan_entrypoints",
49        "mesa_util",
50        "mesa_util_format",
51        "mesa_goldfish_address_space",
52        "libringbuffer",
53        "libqemupipe.ranchu",
54        "libarect",
55        "mesa_gfxstream_aemu",
56        "mesa_gfxstream_guest_android",
57        "mesa_gfxstream_connection_manager",
58        "libgfxstream_rcEnc_static",
59        "libgfxstream_androidemu_static",
60    ],
61    shared_libs: [
62        "liblog",
63        "libcutils",
64        "libbase",
65        "libdrm",
66        "libOpenglCodecCommon",
67    ],
68    cflags: [
69        "-DLOG_TAG=\"goldfish_vulkan\"",
70        "-DVK_NO_PROTOTYPES",
71        "-fstrict-aliasing",
72        "-fvisibility=hidden",
73        "-Wno-missing-field-initializers",
74        "-Wno-unused-function",
75        "-Wno-unused-parameter",
76        "-Wno-cast-calling-convention",
77    ],
78    ldflags: [
79        // Mesa always adds Bsymbolic when available (see 'ld_args_bsymbolic' in Meson build). Duplicate that
80        // behavior here. '--gc-sections' has stronger justification: this lets drivers drop
81        // shared code unused by that specific driver (particularly relevant for Vulkan drivers).
82        "-Wl,-Bsymbolic",
83        "-Wl,--gc-sections",
84    ],
85    srcs: [
86        "gfxstream_vk_device.cpp",
87        "gfxstream_vk_cmd.cpp",
88        "gfxstream_vk_wsi.cpp",
89        ":mesa_vulkan_enc_impl",
90    ],
91    target: {
92        android: {
93            relative_install_path: "hw",
94            static_libs: [
95                "mesa_u_gralloc",
96            ],
97            header_libs: [
98                "hwvulkan_headers",
99                "libnativebase_headers",
100            ],
101            shared_libs: [
102                "libsync",
103                "libhardware",
104                "libnativewindow",
105                "libhidlbase",
106                "libutils",
107            ],
108            srcs: [
109                "gfxstream_vk_android.cpp",
110            ],
111        },
112        host: {
113            cflags: [
114                "-DEND2END_TESTS",
115            ],
116        },
117    },
118}
119