• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2018 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.
14cc_library {
15    name: "libandroidicu",
16
17    // Most code is imported via libandroidicu_static.
18    srcs: [
19        "aicu/AIcu.cpp",
20    ],
21    host_supported: true,
22    unique_host_soname: true,
23
24    // include/aicu/: extra utility APIs added by android
25    // include/unicode/: Includes modified C headers from ICU4C,
26    //                   but excludes C++ headers.
27    // include/uconfig_local.h: local configuration specific for libandroidicu
28    export_include_dirs: ["include"],
29
30    // The implementation of libandroidicu depends on libicuuc and and libicui18n,
31    // but we need to export the headers in include/.
32    //
33    // However, include/unicode has a copy of a subset of header files
34    // as in libicuuc and libicui18n. We can't build C/C++ codes against
35    // both set of headers, since the headers have the same relative paths,
36    // and the compiler will find it ambiguous.
37    //
38    // Instead, we build the implementation of the shim libaray
39    // as a static library aganist libicuuc and libicui18n first,
40    // and export the headers in include/.
41    whole_static_libs: ["libandroidicu_static"],
42    shared_libs: [
43        "libicuuc",
44        "libicui18n",
45        "liblog",
46    ],
47    stubs: {
48        symbol_file: "libandroidicu.map.txt",
49        versions: [
50            "1",
51        ],
52    },
53    cppflags: [
54        "-std=c++11", // Use the same C++ version as libicuuc
55    ],
56    cflags: [
57        "-Wall",
58        "-Werror",
59    ],
60    target: {
61        android: {
62            cflags: [
63                "-DANDROID_LINK_SHARED_ICU4C",
64            ],
65            version_script: "libandroidicu.map.txt",
66        },
67        windows: {
68            enabled: true,
69        },
70    },
71}
72
73// TODO: http://b/120776993 Testing for libandroidicu
74