1// Copyright (C) 2013 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_headers {
16    name: "libminikin-headers-for-tests",
17    export_include_dirs: ["."],
18    shared_libs: ["libharfbuzz_ng"],
19    export_shared_lib_headers: ["libharfbuzz_ng"],
20}
21
22cc_library {
23    name: "libminikin",
24    host_supported: true,
25    srcs: [
26        "BidiUtils.cpp",
27        "CmapCoverage.cpp",
28        "Emoji.cpp",
29        "FontCollection.cpp",
30        "FontFamily.cpp",
31        "FontUtils.cpp",
32        "GraphemeBreak.cpp",
33        "GreedyLineBreaker.cpp",
34        "Hyphenator.cpp",
35        "HyphenatorMap.cpp",
36        "Layout.cpp",
37        "LayoutCore.cpp",
38        "LayoutUtils.cpp",
39        "LineBreaker.cpp",
40        "LineBreakerUtil.cpp",
41        "Locale.cpp",
42        "LocaleListCache.cpp",
43        "MeasuredText.cpp",
44        "Measurement.cpp",
45        "MinikinInternal.cpp",
46        "OptimalLineBreaker.cpp",
47        "SparseBitSet.cpp",
48        "SystemFonts.cpp",
49        "WordBreaker.cpp",
50    ],
51    cflags: ["-Wall", "-Werror"],
52    sanitize: {
53        misc_undefined: [
54            "signed-integer-overflow",
55            "unsigned-integer-overflow",
56        ],
57    },
58    cppflags: [
59        "-Werror",
60        "-Wall",
61        "-Wextra",
62        "-Wthread-safety",
63    ],
64    product_variables: {
65        debuggable: {
66            // Enable assertion on eng and userdebug build.
67            cppflags: ["-DENABLE_ASSERTION"],
68        },
69    },
70    shared_libs: [
71        "liblog",
72        "libharfbuzz_ng",
73    ],
74    header_libs: [
75        "libbase_headers",
76        "libminikin_headers",
77        "libutils_headers",
78    ],
79    export_header_lib_headers: ["libminikin_headers"],
80    whole_static_libs: ["libgtest_prod"],
81
82    clang: true,
83
84    target: {
85        android: {
86            shared_libs: [
87                "libandroidicu",
88            ],
89            export_shared_lib_headers: [
90                "libandroidicu",
91            ],
92        },
93        host: {
94            shared_libs: [
95                "libicui18n",
96                "libicuuc",
97            ],
98            export_shared_lib_headers: [
99                "libicui18n",
100                "libicuuc",
101            ],
102        },
103        windows: {
104            enabled: true,
105            cppflags: [
106                "-Wno-ignored-attributes",
107                "-Wno-thread-safety",
108            ],
109        },
110    },
111}
112