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 shared_libs: [ 49 "libicu", 50 ], 51 export_shared_lib_headers: [ 52 "libicu", 53 ], 54} 55 56cc_library { 57 name: "libminikin", 58 host_supported: true, 59 srcs: [ 60 "BidiUtils.cpp", 61 "CmapCoverage.cpp", 62 "Emoji.cpp", 63 "Font.cpp", 64 "FontCollection.cpp", 65 "FontFamily.cpp", 66 "FontFeatureUtils.cpp", 67 "FontFileParser.cpp", 68 "FontUtils.cpp", 69 "GraphemeBreak.cpp", 70 "GreedyLineBreaker.cpp", 71 "Hyphenator.cpp", 72 "HyphenatorMap.cpp", 73 "Layout.cpp", 74 "LayoutCore.cpp", 75 "LayoutUtils.cpp", 76 "LineBreaker.cpp", 77 "LineBreakerUtil.cpp", 78 "Locale.cpp", 79 "LocaleListCache.cpp", 80 "MeasuredText.cpp", 81 "Measurement.cpp", 82 "MinikinFontFactory.cpp", 83 "MinikinInternal.cpp", 84 "OptimalLineBreaker.cpp", 85 "ScriptUtils.cpp", 86 "SparseBitSet.cpp", 87 "SystemFonts.cpp", 88 "U16StringPiece.cpp", 89 "WordBreaker.cpp", 90 ], 91 defaults: ["libminikin_defaults"], 92 sanitize: { 93 misc_undefined: [ 94 "signed-integer-overflow", 95 "unsigned-integer-overflow", 96 "bounds", 97 ], 98 }, 99 product_variables: { 100 debuggable: { 101 // Enable assertion on eng and userdebug build. 102 srcs: [ 103 "Debug.cpp", 104 ], 105 cppflags: ["-DENABLE_ASSERTION"], 106 }, 107 }, 108 shared_libs: [ 109 "liblog", 110 "libharfbuzz_ng", 111 "libcutils", 112 ], 113 header_libs: [ 114 "libbase_headers", 115 "libminikin_headers", 116 "libutils_headers", 117 ], 118 export_header_lib_headers: ["libminikin_headers"], 119 120 target: { 121 android: { 122 shared_libs: [ 123 "libicu", 124 "aconfig_text_flags_c_lib", 125 ], 126 export_shared_lib_headers: [ 127 "libicu", 128 ], 129 generated_headers: [ 130 "cxx-bridge-header", 131 "libminikin_cxx_bridge_header", 132 ], 133 whole_static_libs: [ 134 "libminikin_rust_ffi", 135 ], 136 }, 137 host: { 138 shared_libs: [ 139 "libicui18n", 140 "libicuuc", 141 ], 142 export_shared_lib_headers: [ 143 "libicui18n", 144 "libicuuc", 145 ], 146 generated_headers: [ 147 "cxx-bridge-header", 148 "libminikin_cxx_bridge_header", 149 ], 150 }, 151 not_windows: { 152 whole_static_libs: [ 153 "libminikin_rust_ffi", 154 ], 155 }, 156 windows: { 157 enabled: true, 158 cppflags: [ 159 "-Wno-ignored-attributes", 160 "-Wno-thread-safety", 161 ], 162 }, 163 }, 164 165 afdo: true, 166 167} 168