1# Copyright (c) 2021-2023 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/ohos.gni") 15import("//foundation/arkui/ace_engine/ace_config.gni") 16import("//third_party/flutter/flutter_config.gni") 17 18config("libharfbuzz_compile_flags") { 19 cflags_cc = [ 20 "-std=c++14", 21 "-fno-exceptions", 22 "-fno-rtti", 23 "-Os", 24 ] 25 26 cflags = [ 27 "-w", 28 "-fstrict-aliasing", 29 "-Os", 30 "-fdata-sections", 31 "-ffunction-sections", 32 "-gline-tables-only", 33 "-funwind-tables", 34 "-Wno-unused-parameter", 35 ] 36 37 include_dirs = [ 38 "$flutter_root/skia/third_party/harfbuzz", 39 "$flutter_root/skia/third_party/externals/harfbuzz/src", 40 ] 41} 42 43template("ace_libharfbuzz") { 44 forward_variables_from(invoker, "*") 45 46 ohos_source_set(target_name) { 47 part_name = flutter_part 48 subsystem_name = flutter_subsystem 49 license_file = "$flutter_root/skia/third_party/externals/harfbuzz/COPYING" 50 defines += invoker.defines 51 defines += [ 52 "HAVE_ICU", 53 "HAVE_ICU_BUILTIN", 54 "HAVE_INTEL_ATOMIC_PRIMITIVES", 55 "HAVE_OT", 56 "U_USING_ICU_NAMESPACE=0", 57 "SK_USING_THIRD_PARTY_ICU", 58 "UPRV_BLOCK_MACRO_BEGIN=", 59 "UPRV_BLOCK_MACRO_END=", 60 ] 61 cflags_cc += invoker.cflags_cc 62 63 configs = [ ":libharfbuzz_compile_flags" ] 64 if (platform == "android") { 65 configs += [ "$ace_root/build:reduce_eh_frame_config" ] 66 } 67 68 sources = [ 69 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-aat-layout.cc", 70 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-aat-map.cc", 71 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-blob.cc", 72 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-buffer-serialize.cc", 73 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-buffer.cc", 74 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-common.cc", 75 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-face.cc", 76 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-font.cc", 77 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-icu.cc", 78 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-map.cc", 79 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-cff1-table.cc", 80 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-cff2-table.cc", 81 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-color.cc", 82 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-face.cc", 83 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-font.cc", 84 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-layout.cc", 85 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-map.cc", 86 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-math.cc", 87 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-name.cc", 88 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-arabic.cc", 89 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-default.cc", 90 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-hangul.cc", 91 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-hebrew.cc", 92 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-indic-table.cc", 93 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-indic.cc", 94 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-khmer.cc", 95 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-myanmar.cc", 96 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-thai.cc", 97 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-use-table.cc", 98 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-use.cc", 99 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-vowel-constraints.cc", 100 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-fallback.cc", 101 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-normalize.cc", 102 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape.cc", 103 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-tag.cc", 104 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-var.cc", 105 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-set.cc", 106 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-shape-plan.cc", 107 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-shape.cc", 108 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-shaper.cc", 109 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-static.cc", 110 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset-cff-common.cc", 111 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset-cff1.cc", 112 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset-cff2.cc", 113 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset-input.cc", 114 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset-plan.cc", 115 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset.cc", 116 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ucd.cc", 117 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-unicode.cc", 118 "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-warning.cc", 119 ] 120 121 deps = [ "$ace_flutter_engine_root/icu:ace_libicu_$platform" ] 122 } 123} 124 125foreach(item, ace_platforms) { 126 ace_libharfbuzz("ace_libharfbuzz_" + item.name) { 127 platform = item.name 128 defines = [] 129 cflags_cc = [] 130 config = { 131 } 132 133 if (defined(item.config)) { 134 config = item.config 135 } 136 137 if (defined(config.defines)) { 138 defines = config.defines 139 } 140 141 if (defined(config.cflags_cc)) { 142 cflags_cc = config.cflags_cc 143 } 144 } 145} 146