1// Copyright (C) 2017 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
15package {
16    default_applicable_licenses: [
17        "frameworks_native_libs_nativewindow_license",
18    ],
19}
20
21// Added automatically by a large-scale-change
22// See: http://go/android-license-faq
23license {
24    name: "frameworks_native_libs_nativewindow_license",
25    visibility: [":__subpackages__"],
26    license_kinds: [
27        "SPDX-license-identifier-Apache-2.0",
28    ],
29    license_text: [
30        "NOTICE",
31    ],
32}
33
34ndk_headers {
35    name: "libnativewindow_ndk_headers",
36    from: "include/android",
37    to: "android",
38    srcs: ["include/android/*.h"],
39    license: "NOTICE",
40}
41
42// TODO(b/118715870): cleanup header files
43cc_library_headers {
44    name: "libnativewindow_headers",
45    export_include_dirs: ["include"],
46    vendor_available: true,
47    // TODO(b/153609531): remove when no longer needed.
48    native_bridge_supported: true,
49    min_sdk_version: "29",
50    host_supported: true,
51}
52
53ndk_library {
54    name: "libnativewindow",
55    symbol_file: "libnativewindow.map.txt",
56
57    // Android O
58    first_version: "26",
59}
60
61cc_library {
62    name: "libnativewindow",
63    llndk: {
64        symbol_file: "libnativewindow.map.txt",
65        unversioned: true,
66        override_export_include_dirs: [
67            "include"
68        ],
69    },
70    export_include_dirs: [
71        "include",
72        "include-private",
73    ],
74
75    clang: true,
76
77    cflags: [
78        "-Wall",
79        "-Werror",
80        "-Wno-enum-compare",
81        "-Wno-unused-function",
82    ],
83
84    version_script: "libnativewindow.map.txt",
85
86    srcs: [
87        "AHardwareBuffer.cpp",
88        "ANativeWindow.cpp",
89    ],
90
91    shared_libs: [
92        "libcutils",
93        "liblog",
94        "libutils",
95        "libui",
96        "android.hardware.graphics.common@1.1",
97    ],
98
99    static_libs: [
100        "libarect",
101        "libgrallocusage",
102    ],
103
104    header_libs: [
105        "libnativebase_headers",
106        "libnativewindow_headers",
107    ],
108
109    // headers we include in our public headers
110    export_static_lib_headers: [
111        "libarect",
112    ],
113
114    export_header_lib_headers: [
115        "libnativebase_headers",
116    ],
117
118    stubs: {
119        symbol_file: "libnativewindow.map.txt",
120        versions: ["29"],
121    },
122}
123
124subdirs = ["tests"]
125