blob: 7e7fdc49320c6cb119a5474b731f0564481bdd66 [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
Dan Albert0fbb5322016-10-04 17:49:33 -070025ndk_library {
Dan Willemsen219db6c2017-04-07 15:48:39 -070026 name: "libvulkan",
Dan Albert0fbb5322016-10-04 17:49:33 -070027 symbol_file: "libvulkan.map.txt",
28 first_version: "24",
Dan Albertb9c62a62017-01-05 15:58:50 -080029 unversioned_until: "current",
Dan Albert0fbb5322016-10-04 17:49:33 -070030}
Colin Cross7884c192016-12-05 13:26:22 -080031
Tom Murphyea321842024-06-14 18:26:58 +000032aconfig_declarations {
33 name: "libvulkan_flags",
34 package: "com.android.graphics.libvulkan.flags",
35 container: "system",
36 srcs: ["libvulkan_flags.aconfig"],
37}
38
39cc_aconfig_library {
40 name: "libvulkanflags",
41 aconfig_declarations: "libvulkan_flags",
42}
43
Elliott Hughes13ec0b82025-03-13 12:50:54 -070044cc_defaults {
45 name: "libvulkan_defaults",
46
Colin Cross7884c192016-12-05 13:26:22 -080047 sanitize: {
48 misc_undefined: ["integer"],
49 },
50
51 cflags: [
52 "-DLOG_TAG=\"vulkan\"",
53 "-DVK_USE_PLATFORM_ANDROID_KHR",
54 "-DVK_NO_PROTOTYPES",
55 "-fvisibility=hidden",
56 "-fstrict-aliasing",
Colin Cross1383d9f2019-11-06 13:33:40 -080057 "-Wextra",
Colin Cross7884c192016-12-05 13:26:22 -080058 "-Werror",
59 "-Wno-padded",
Colin Cross1383d9f2019-11-06 13:33:40 -080060 "-Wno-sign-compare",
Colin Cross7884c192016-12-05 13:26:22 -080061 "-Wno-switch-enum",
Colin Cross1383d9f2019-11-06 13:33:40 -080062 "-Wno-unused-variable",
63 "-Wno-unused-function",
Colin Cross7884c192016-12-05 13:26:22 -080064
dimitrya7cc50d2018-12-10 17:06:07 +010065 // Have clang emit complete debug_info.
66 "-fstandalone-debug",
67
Colin Cross7884c192016-12-05 13:26:22 -080068 //"-DLOG_NDEBUG=0",
69 ],
70
71 cppflags: [
Colin Cross7884c192016-12-05 13:26:22 -080072 "-Wno-c99-extensions",
73 "-Wno-c++98-compat-pedantic",
74 "-Wno-exit-time-destructors",
Dan Stoza71bded52016-10-19 11:10:33 -070075 "-Wno-float-equal",
Colin Cross7884c192016-12-05 13:26:22 -080076 "-Wno-global-constructors",
77 "-Wno-zero-length-array",
78 ],
Elliott Hughes13ec0b82025-03-13 12:50:54 -070079}
80
81cc_library {
82 name: "libvulkanallocator",
83 defaults: ["libvulkan_defaults"],
84 cflags: [
85 // This code uses malloc_usable_size(),
86 // and thus can't be built with _FORTIFY_SOURCE=3.
87 "-U_FORTIFY_SOURCE",
88 "-D_FORTIFY_SOURCE=2",
89 ],
90 srcs: [
91 "allocator.cpp",
92 ],
93 header_libs: [
94 "vulkan_headers",
95 ],
96}
97
98cc_library_shared {
99 name: "libvulkan",
100 defaults: ["libvulkan_defaults"],
101 llndk: {
102 symbol_file: "libvulkan.map.txt",
103 export_llndk_headers: [
104 "vulkan_headers",
105 ],
106 },
Colin Cross7884c192016-12-05 13:26:22 -0800107
108 srcs: [
109 "api.cpp",
110 "api_gen.cpp",
111 "debug_report.cpp",
112 "driver.cpp",
113 "driver_gen.cpp",
114 "layers_extensions.cpp",
115 "stubhal.cpp",
116 "swapchain.cpp",
Colin Cross7884c192016-12-05 13:26:22 -0800117 ],
118
Stephen Kiazyke77dce22017-03-14 15:38:12 -0700119 header_libs: [
Jesse Hall408eda02019-04-12 15:39:16 -0700120 "hwvulkan_headers",
Paul Duffin08026182019-09-12 15:01:28 +0100121 "libnativeloader-headers",
Colin Cross7884c192016-12-05 13:26:22 -0800122 "vulkan_headers",
Sundong Ahnbc37dd52020-04-23 21:21:00 +0900123 "libsurfaceflinger_headers",
Colin Cross7884c192016-12-05 13:26:22 -0800124 ],
Jesse Hall408eda02019-04-12 15:39:16 -0700125 export_header_lib_headers: ["vulkan_headers"],
Colin Cross7884c192016-12-05 13:26:22 -0800126 shared_libs: [
Courtney Goeltzenleuchter7671d462018-01-24 11:51:01 -0800127 "android.hardware.configstore@1.0",
128 "android.hardware.configstore-utils",
Jaekyun Seokd56dec82016-11-25 16:20:40 +0900129 "libziparchive",
Colin Cross7884c192016-12-05 13:26:22 -0800130 "libhardware",
131 "libsync",
132 "libbase",
Courtney Goeltzenleuchter7671d462018-01-24 11:51:01 -0800133 "libhidlbase",
Colin Cross7884c192016-12-05 13:26:22 -0800134 "liblog",
Mathias Agopian991d2542017-02-06 13:51:32 -0800135 "libui",
Jiyong Park27c39e12017-05-08 13:00:02 +0900136 "libgraphicsenv",
Colin Cross7884c192016-12-05 13:26:22 -0800137 "libutils",
138 "libcutils",
139 "libz",
Jiyong Park2d81f3c2019-01-29 00:36:19 +0900140 "libnativebridge_lazy",
141 "libnativeloader_lazy",
Brian Andersondc96fdf2017-03-20 16:54:25 -0700142 "libnativewindow",
Yiwei Zhang06c66fb2020-10-14 08:42:26 -0700143 "libvndksupport",
Jooyung Han749b0ec2023-11-15 13:38:06 +0900144 "libdl_android",
Daniel Kochf25f5bb2017-10-05 00:26:58 -0400145 "android.hardware.graphics.common@1.0",
Sundong Ahnbc37dd52020-04-23 21:21:00 +0900146 "libSurfaceFlingerProp",
Colin Cross7884c192016-12-05 13:26:22 -0800147 ],
Tom Murphyea321842024-06-14 18:26:58 +0000148 static_libs: [
149 "libgrallocusage",
Elliott Hughes13ec0b82025-03-13 12:50:54 -0700150 "libvulkanallocator",
Tom Murphyea321842024-06-14 18:26:58 +0000151 "libvulkanflags",
152 ],
Colin Cross7884c192016-12-05 13:26:22 -0800153}