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        "Hyphenator.cpp",
27    ],
28    cflags: ["-Wall", "-Werror"],
29    target: {
30        android: {
31            srcs: [
32                "BidiUtils.cpp",
33                "CmapCoverage.cpp",
34                "Emoji.cpp",
35                "FontCollection.cpp",
36                "FontFamily.cpp",
37                "FontUtils.cpp",
38                "GraphemeBreak.cpp",
39                "GreedyLineBreaker.cpp",
40                "HyphenatorMap.cpp",
41                "Layout.cpp",
42                "LayoutUtils.cpp",
43                "LineBreaker.cpp",
44                "LineBreakerUtil.cpp",
45                "Locale.cpp",
46                "LocaleListCache.cpp",
47                "MeasuredText.cpp",
48                "Measurement.cpp",
49                "MinikinInternal.cpp",
50                "OptimalLineBreaker.cpp",
51                "SparseBitSet.cpp",
52                "WordBreaker.cpp",
53            ],
54            shared_libs: [
55                "libharfbuzz_ng",
56                "libft2",
57                "libz",
58                "libutils",
59            ],
60            // TODO: clean up Minikin so it doesn't need the freetype include
61            export_shared_lib_headers: ["libft2"],
62
63            sanitize: {
64                misc_undefined: [
65                    "signed-integer-overflow",
66                    // b/26432628.
67                    //"unsigned-integer-overflow",
68                ],
69            },
70        },
71    },
72    cppflags: [
73        "-Werror",
74        "-Wall",
75        "-Wextra",
76        "-Wthread-safety",
77    ],
78    product_variables: {
79        debuggable: {
80            // Enable assertion on eng and userdebug build.
81            cppflags: ["-DENABLE_ASSERTION"],
82        },
83    },
84    shared_libs: [
85        "liblog",
86        "libicuuc",
87    ],
88    header_libs: ["libminikin_headers"],
89    export_header_lib_headers: ["libminikin_headers"],
90    export_shared_lib_headers: ["libicuuc"],
91    whole_static_libs: ["libgtest_prod"],
92
93    clang: true,
94}
95