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 15package { 16 default_applicable_licenses: ["Android-Apache-2.0"], 17} 18 19cc_library_headers { 20 name: "libminikin-headers-for-tests", 21 export_include_dirs: ["."], 22 shared_libs: ["libharfbuzz_ng"], 23 export_shared_lib_headers: ["libharfbuzz_ng"], 24} 25 26cc_library_static { 27 name: "libminikin_from_rust_to_cpp", 28 cpp_std: "c++20", 29 host_supported: true, 30 cflags: [ 31 "-Wall", 32 "-Wextra", 33 "-Werror", 34 ], 35 srcs: [ 36 "ffi/IcuBridge.cpp", 37 ], 38 generated_headers: [ 39 "cxx-bridge-header", 40 "libminikin_cxx_bridge_header", 41 ], 42 generated_sources: [ 43 "libminikin_cxx_bridge_code", 44 ], 45 lto: { 46 never: true, 47 }, 48 target: { 49 android: { 50 shared_libs: [ 51 "libicu", 52 ], 53 export_shared_lib_headers: [ 54 "libicu", 55 ], 56 }, 57 host: { 58 shared_libs: [ 59 "libicui18n", 60 "libicuuc", 61 ], 62 export_shared_lib_headers: [ 63 "libicui18n", 64 "libicuuc", 65 ], 66 }, 67 }, 68} 69 70cc_library { 71 name: "libminikin", 72 host_supported: true, 73 srcs: [ 74 "BidiUtils.cpp", 75 "CmapCoverage.cpp", 76 "Emoji.cpp", 77 "Font.cpp", 78 "FontCollection.cpp", 79 "FontFakery.cpp", 80 "FontFamily.cpp", 81 "FontFeatureUtils.cpp", 82 "FontFileParser.cpp", 83 "FontUtils.cpp", 84 "GraphemeBreak.cpp", 85 "GreedyLineBreaker.cpp", 86 "Hyphenator.cpp", 87 "HyphenatorMap.cpp", 88 "Layout.cpp", 89 "LayoutCore.cpp", 90 "LayoutUtils.cpp", 91 "LineBreaker.cpp", 92 "LineBreakerUtil.cpp", 93 "Locale.cpp", 94 "LocaleListCache.cpp", 95 "MeasuredText.cpp", 96 "Measurement.cpp", 97 "MinikinFontFactory.cpp", 98 "MinikinInternal.cpp", 99 "OptimalLineBreaker.cpp", 100 "ScriptUtils.cpp", 101 "SparseBitSet.cpp", 102 "SystemFonts.cpp", 103 "U16StringPiece.cpp", 104 "WordBreaker.cpp", 105 ], 106 defaults: ["libminikin_defaults"], 107 sanitize: { 108 misc_undefined: [ 109 "signed-integer-overflow", 110 "unsigned-integer-overflow", 111 "bounds", 112 ], 113 }, 114 product_variables: { 115 debuggable: { 116 // Enable assertion on eng and userdebug build. 117 srcs: [ 118 "Debug.cpp", 119 ], 120 cppflags: ["-DENABLE_ASSERTION"], 121 }, 122 }, 123 shared_libs: [ 124 "liblog", 125 "libharfbuzz_ng", 126 "libcutils", 127 ], 128 header_libs: [ 129 "libbase_headers", 130 "libminikin_headers", 131 "libutils_headers", 132 ], 133 export_header_lib_headers: ["libminikin_headers"], 134 135 target: { 136 android: { 137 shared_libs: [ 138 "libicu", 139 "aconfig_text_flags_c_lib", 140 "server_configurable_flags", 141 ], 142 export_shared_lib_headers: [ 143 "libicu", 144 ], 145 generated_headers: [ 146 "cxx-bridge-header", 147 "libminikin_cxx_bridge_header", 148 ], 149 whole_static_libs: [ 150 "libminikin_rust_ffi", 151 "libflags_rust_cpp_bridge", 152 ], 153 }, 154 host: { 155 shared_libs: [ 156 "libicui18n", 157 "libicuuc", 158 ], 159 export_shared_lib_headers: [ 160 "libicui18n", 161 "libicuuc", 162 ], 163 generated_headers: [ 164 "cxx-bridge-header", 165 "libminikin_cxx_bridge_header", 166 ], 167 }, 168 linux: { 169 whole_static_libs: [ 170 "libminikin_rust_ffi", 171 ], 172 }, 173 windows: { 174 enabled: true, 175 cppflags: [ 176 "-Wno-ignored-attributes", 177 "-Wno-thread-safety", 178 ], 179 }, 180 }, 181 182 afdo: true, 183 184} 185