• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// 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
15// Headers module is in external/vulkan-headers/Android.bp.
16package {
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
25// 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
32ndk_library {
33    name: "libvulkan",
34    symbol_file: "libvulkan.map.txt",
35    first_version: "24",
36    unversioned_until: "current",
37}
38
39aconfig_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
51cc_defaults {
52    name: "libvulkan_defaults",
53
54    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",
64        "-Wextra",
65        "-Werror",
66        "-Wno-padded",
67        "-Wno-sign-compare",
68        "-Wno-switch-enum",
69        "-Wno-unused-variable",
70        "-Wno-unused-function",
71
72        // Have clang emit complete debug_info.
73        "-fstandalone-debug",
74
75        //"-DLOG_NDEBUG=0",
76    ],
77
78    cppflags: [
79        "-Wno-c99-extensions",
80        "-Wno-c++98-compat-pedantic",
81        "-Wno-exit-time-destructors",
82        "-Wno-float-equal",
83        "-Wno-global-constructors",
84        "-Wno-zero-length-array",
85    ],
86}
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    },
114
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",
124    ],
125
126    header_libs: [
127        "hwvulkan_headers",
128        "libnativeloader-headers",
129        "vulkan_headers",
130        "libsurfaceflinger_headers",
131    ],
132    export_header_lib_headers: ["vulkan_headers"],
133    shared_libs: [
134        "android.hardware.configstore@1.0",
135        "android.hardware.configstore-utils",
136        "libziparchive",
137        "libhardware",
138        "libsync",
139        "libbase",
140        "libhidlbase",
141        "liblog",
142        "libui",
143        "libgraphicsenv",
144        "libutils",
145        "libcutils",
146        "libz",
147        "libnativebridge_lazy",
148        "libnativeloader_lazy",
149        "libnativewindow",
150        "libvndksupport",
151        "libdl_android",
152        "android.hardware.graphics.common@1.0",
153        "libSurfaceFlingerProp",
154    ],
155    static_libs: [
156        "libgrallocusage",
157        "libvulkanallocator",
158        "libvulkanflags",
159    ],
160}
161