blob: d75058abe3984bfbf43185a85db2efd646253964 [file] [log] [blame]
Dan Albert0fbb5322016-10-04 17:49:33 -07001// Copyright (C) 2016 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Jesse Hallb9d7b812019-04-12 16:05:37 -070015// Headers module is in external/vulkan-headers/Android.bp.
Bob Badour3c538232021-02-12 21:26:48 -080016package {
17 // See: http://go/android-license-faq
18 // A large-scale-change added 'default_applicable_licenses' to import
19 // all of the 'license_kinds' from "frameworks_native_license"
20 // to get the below license kinds:
21 // SPDX-license-identifier-Apache-2.0
22 default_applicable_licenses: ["frameworks_native_license"],
23}
24
Tom Murphy244dbe42025-02-19 18:50:46 +000025// Expose internal header files to test testing binary
26cc_library_headers {
27 name: "libvulkanprivate_headers-testing",
28 export_include_dirs: ["."],
29 visibility: ["//frameworks/native/vulkan/tests"],
30}
31
Dan Albert0fbb5322016-10-04 17:49:33 -070032ndk_library {
Dan Willemsen219db6c2017-04-07 15:48:39 -070033 name: "libvulkan",
Dan Albert0fbb5322016-10-04 17:49:33 -070034 symbol_file: "libvulkan.map.txt",
35 first_version: "24",
Dan Albertb9c62a62017-01-05 15:58:50 -080036 unversioned_until: "current",
Dan Albert0fbb5322016-10-04 17:49:33 -070037}
Colin Cross7884c192016-12-05 13:26:22 -080038
Tom Murphyea321842024-06-14 18:26:58 +000039aconfig_declarations {
40 name: "libvulkan_flags",
41 package: "com.android.graphics.libvulkan.flags",
42 container: "system",
43 srcs: ["libvulkan_flags.aconfig"],
44}
45
46cc_aconfig_library {
47 name: "libvulkanflags",
48 aconfig_declarations: "libvulkan_flags",
49}
50
Elliott Hughes13ec0b82025-03-13 12:50:54 -070051cc_defaults {
52 name: "libvulkan_defaults",
53
Colin Cross7884c192016-12-05 13:26:22 -080054 sanitize: {
55 misc_undefined: ["integer"],
56 },
57
58 cflags: [
59 "-DLOG_TAG=\"vulkan\"",
60 "-DVK_USE_PLATFORM_ANDROID_KHR",
61 "-DVK_NO_PROTOTYPES",
62 "-fvisibility=hidden",
63 "-fstrict-aliasing",
Colin Cross1383d9f2019-11-06 13:33:40 -080064 "-Wextra",
Colin Cross7884c192016-12-05 13:26:22 -080065 "-Werror",
66 "-Wno-padded",
Colin Cross1383d9f2019-11-06 13:33:40 -080067 "-Wno-sign-compare",
Colin Cross7884c192016-12-05 13:26:22 -080068 "-Wno-switch-enum",
Colin Cross1383d9f2019-11-06 13:33:40 -080069 "-Wno-unused-variable",
70 "-Wno-unused-function",
Colin Cross7884c192016-12-05 13:26:22 -080071
dimitrya7cc50d2018-12-10 17:06:07 +010072 // Have clang emit complete debug_info.
73 "-fstandalone-debug",
74
Colin Cross7884c192016-12-05 13:26:22 -080075 //"-DLOG_NDEBUG=0",
76 ],
77
78 cppflags: [
Colin Cross7884c192016-12-05 13:26:22 -080079 "-Wno-c99-extensions",
80 "-Wno-c++98-compat-pedantic",
81 "-Wno-exit-time-destructors",
Dan Stoza71bded52016-10-19 11:10:33 -070082 "-Wno-float-equal",
Colin Cross7884c192016-12-05 13:26:22 -080083 "-Wno-global-constructors",
84 "-Wno-zero-length-array",
85 ],
Elliott Hughes13ec0b82025-03-13 12:50:54 -070086}
87
88cc_library {
89 name: "libvulkanallocator",
90 defaults: ["libvulkan_defaults"],
91 cflags: [
92 // This code uses malloc_usable_size(),
93 // and thus can't be built with _FORTIFY_SOURCE=3.
94 "-U_FORTIFY_SOURCE",
95 "-D_FORTIFY_SOURCE=2",
96 ],
97 srcs: [
98 "allocator.cpp",
99 ],
100 header_libs: [
101 "vulkan_headers",
102 ],
103}
104
105cc_library_shared {
106 name: "libvulkan",
107 defaults: ["libvulkan_defaults"],
108 llndk: {
109 symbol_file: "libvulkan.map.txt",
110 export_llndk_headers: [
111 "vulkan_headers",
112 ],
113 },
Colin Cross7884c192016-12-05 13:26:22 -0800114
115 srcs: [
116 "api.cpp",
117 "api_gen.cpp",
118 "debug_report.cpp",
119 "driver.cpp",
120 "driver_gen.cpp",
121 "layers_extensions.cpp",
122 "stubhal.cpp",
123 "swapchain.cpp",
Colin Cross7884c192016-12-05 13:26:22 -0800124 ],
125
Stephen Kiazyke77dce22017-03-14 15:38:12 -0700126 header_libs: [
Jesse Hall408eda02019-04-12 15:39:16 -0700127 "hwvulkan_headers",
Paul Duffin08026182019-09-12 15:01:28 +0100128 "libnativeloader-headers",
Colin Cross7884c192016-12-05 13:26:22 -0800129 "vulkan_headers",
Sundong Ahnbc37dd52020-04-23 21:21:00 +0900130 "libsurfaceflinger_headers",
Colin Cross7884c192016-12-05 13:26:22 -0800131 ],
Jesse Hall408eda02019-04-12 15:39:16 -0700132 export_header_lib_headers: ["vulkan_headers"],
Colin Cross7884c192016-12-05 13:26:22 -0800133 shared_libs: [
Courtney Goeltzenleuchter7671d462018-01-24 11:51:01 -0800134 "android.hardware.configstore@1.0",
135 "android.hardware.configstore-utils",
Jaekyun Seokd56dec82016-11-25 16:20:40 +0900136 "libziparchive",
Colin Cross7884c192016-12-05 13:26:22 -0800137 "libhardware",
138 "libsync",
139 "libbase",
Courtney Goeltzenleuchter7671d462018-01-24 11:51:01 -0800140 "libhidlbase",
Colin Cross7884c192016-12-05 13:26:22 -0800141 "liblog",
Mathias Agopian991d2542017-02-06 13:51:32 -0800142 "libui",
Jiyong Park27c39e12017-05-08 13:00:02 +0900143 "libgraphicsenv",
Colin Cross7884c192016-12-05 13:26:22 -0800144 "libutils",
145 "libcutils",
146 "libz",
Jiyong Park2d81f3c2019-01-29 00:36:19 +0900147 "libnativebridge_lazy",
148 "libnativeloader_lazy",
Brian Andersondc96fdf2017-03-20 16:54:25 -0700149 "libnativewindow",
Yiwei Zhang06c66fb2020-10-14 08:42:26 -0700150 "libvndksupport",
Jooyung Han749b0ec2023-11-15 13:38:06 +0900151 "libdl_android",
Daniel Kochf25f5bb2017-10-05 00:26:58 -0400152 "android.hardware.graphics.common@1.0",
Sundong Ahnbc37dd52020-04-23 21:21:00 +0900153 "libSurfaceFlingerProp",
Colin Cross7884c192016-12-05 13:26:22 -0800154 ],
Tom Murphyea321842024-06-14 18:26:58 +0000155 static_libs: [
156 "libgrallocusage",
Elliott Hughes13ec0b82025-03-13 12:50:54 -0700157 "libvulkanallocator",
Tom Murphyea321842024-06-14 18:26:58 +0000158 "libvulkanflags",
159 ],
Colin Cross7884c192016-12-05 13:26:22 -0800160}