• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2009 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
15cc_library {
16    name: "libnativehelper",
17    host_supported: true,
18    srcs: [
19        "JNIHelp.cpp",
20        "JniConstants.cpp",
21        "toStringArray.cpp",
22        "JniInvocation.cpp",
23    ],
24
25    target: {
26        android: {
27            srcs: ["AsynchronousCloseMonitor.cpp"],
28            shared_libs: ["libdl"],
29        },
30        linux: {
31            srcs: ["AsynchronousCloseMonitor.cpp"],
32            host_ldlibs: ["-ldl"],
33        },
34   },
35
36    shared_libs: [
37        "liblog",
38    ],
39    clang: true,
40    cflags: [
41        "-Werror",
42        "-fvisibility=protected",
43    ],
44    export_include_dirs: ["include", "platform_include"],
45}
46
47//
48// NDK-only build for the target (device), using libc++.
49// - Relies only on NDK exposed functionality.
50// - This doesn't include JniInvocation.
51//
52
53cc_library_shared {
54    name: "libnativehelper_compat_libc++",
55    clang: true,
56    local_include_dirs: ["include/nativehelper"],
57    export_include_dirs: ["include/nativehelper"],
58    cflags: ["-Werror"],
59    srcs: [
60        "JNIHelp.cpp",
61        "JniConstants.cpp",
62        "toStringArray.cpp",
63    ],
64    shared_libs: [
65        "liblog",
66        "libdl",
67    ],
68    sdk_version: "19",
69    stl: "c++_static",
70}
71
72ndk_headers {
73    name: "ndk_jni.h",
74    from: "include/nativehelper",
75    to: "",
76    srcs: ["include/nativehelper/jni.h"],
77    license: "NOTICE",
78}
79
80//
81// Tests.
82//
83
84subdirs = ["tests"]
85