• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2025 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.lvp",
24    host_supported: true,
25    defaults: [
26        "mesa_common_defaults",
27    ],
28    header_libs: [
29        "mesa_gallium_headers",
30        "mesa_gallium_auxiliary_headers",
31        "mesa_gallium_drivers_headers",
32        "mesa_llvmpipe_headers",
33        "mesa_nir_headers",
34        "mesa_compiler_headers",
35    ],
36    generated_headers: [
37        "vk_cmd_enqueue_entrypoints_header",
38        "git_sha1_header",
39        "vk_cmd_queue_header",
40        "vk_physical_device_features_header",
41        "vk_physical_device_properties_header",
42        "vk_dispatch_trampolines_header",
43        "spirv_info_header",
44        "nir_intrinsics_header",
45        "nir_intrinsics_indices_header",
46        "etc2_rgba_stitch_glsl.h",
47        "vk_cmd_queue_header",
48        "vk_cmd_enqueue_entrypoints_header",
49        "spirv_info_header",
50        "vk_dispatch_table_header",
51        "vk_enum_to_str_header",
52        "nir_opcodes_header",
53        "builtin_types_header",
54        "wsi_common_entrypoints_header",
55        "u_format_gen_header",
56        "mesa_lvp_vk_entrypoints_header",
57        "vk_struct_type_cast_header",
58        "ir_expression_operation_header",
59        "vk_format_info_header",
60        "vk_extensions_header",
61        "nir_builder_opcodes_header",
62        "vk_common_entrypoints_header",
63    ],
64    generated_sources: [
65        "mesa_lvp_vk_entrypoints_impl",
66    ],
67    srcs: [
68        ":mesa_lavapipe_files",
69        "lavapipe_target.c",
70    ],
71    cflags: [
72        "-DGALLIUM_LLVMPIPE",
73        "-DLVP_USE_WSI_PLATFORM",
74    ],
75    ldflags: [
76        // Mesa always adds Bsymbolic when available (see 'ld_args_bsymbolic' in Meson build). Duplicate that
77        // behavior here. '--gc-sections' has stronger justification: this lets drivers drop
78        // shared code unused by that specific driver (particularly relevant for Vulkan drivers).
79        "-Wl,-Bsymbolic",
80        "-Wl,--gc-sections",
81    ],
82    whole_static_libs: [
83        "mesa_vulkan_util",
84        "mesa_vulkan_runtime",
85        "mesa_vulkan_wsi",
86    ],
87    static_libs: [
88        "mesa_util_c11",
89        "mesa_util",
90        "mesa_nir",
91        "mesa_compiler",
92        "mesa_util_format",
93        "mesa_gallium",
94        "mesa_pipe_loader_static",
95        "mesa_glsl",
96        "mesa_llvmpipe",
97        "mesa_ws_null",
98        "mesa_blake3",
99        "mesa_spirv",
100        "mesa_wsw",
101        "mesa_loader",
102        "libLLVM16_swiftshader",
103    ],
104    shared_libs: [
105        "libzstd",
106    ],
107    target: {
108        android: {
109            srcs: [
110                ":mesa_lvp_android_files",
111            ],
112            static_libs: [
113                "mesa_u_gralloc",
114            ],
115            header_libs: [
116                "hwvulkan_headers",
117                "libnativebase_headers",
118            ],
119            shared_libs: [
120                "libsync",
121                "libhardware",
122                "libnativewindow",
123                "libhidlbase",
124                "libutils",
125                "liblog",
126                "libcutils",
127            ],
128        },
129    },
130}
131