• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  ]
24
25  cflags = [
26    "-w",
27    "-fstrict-aliasing",
28    "-fdata-sections",
29    "-ffunction-sections",
30    "-gline-tables-only",
31    "-funwind-tables",
32    "-Wno-unused-parameter",
33  ]
34
35  include_dirs = [
36    "$flutter_root/skia/third_party/harfbuzz",
37    "$flutter_root/skia/third_party/externals/harfbuzz/src",
38  ]
39}
40
41template("ace_libharfbuzz") {
42  forward_variables_from(invoker, "*")
43
44  ohos_source_set(target_name) {
45    part_name = flutter_part
46    subsystem_name = flutter_subsystem
47    license_file = "$flutter_root/skia/third_party/externals/harfbuzz/COPYING"
48    defines += invoker.defines
49    defines += [
50      "HAVE_ICU",
51      "HAVE_ICU_BUILTIN",
52      "HAVE_INTEL_ATOMIC_PRIMITIVES",
53      "HAVE_OT",
54      "U_USING_ICU_NAMESPACE=0",
55      "SK_USING_THIRD_PARTY_ICU",
56      "UPRV_BLOCK_MACRO_BEGIN=",
57      "UPRV_BLOCK_MACRO_END=",
58    ]
59    cflags_cc += invoker.cflags_cc
60
61    configs = [ ":libharfbuzz_compile_flags" ]
62    if (platform == "android") {
63      configs += [ "$ace_root/build:reduce_eh_frame_config" ]
64    }
65
66    sources = [
67      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-aat-layout.cc",
68      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-aat-map.cc",
69      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-blob.cc",
70      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-buffer-serialize.cc",
71      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-buffer.cc",
72      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-common.cc",
73      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-face.cc",
74      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-font.cc",
75      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-icu.cc",
76      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-map.cc",
77      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-cff1-table.cc",
78      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-cff2-table.cc",
79      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-color.cc",
80      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-face.cc",
81      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-font.cc",
82      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-layout.cc",
83      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-map.cc",
84      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-math.cc",
85      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-name.cc",
86      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-arabic.cc",
87      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-default.cc",
88      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-hangul.cc",
89      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-hebrew.cc",
90      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-indic-table.cc",
91      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-indic.cc",
92      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-khmer.cc",
93      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-myanmar.cc",
94      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-thai.cc",
95      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-use-table.cc",
96      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-use.cc",
97      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-vowel-constraints.cc",
98      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-fallback.cc",
99      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-normalize.cc",
100      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape.cc",
101      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-tag.cc",
102      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-var.cc",
103      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-set.cc",
104      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-shape-plan.cc",
105      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-shape.cc",
106      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-shaper.cc",
107      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-static.cc",
108      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset-cff-common.cc",
109      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset-cff1.cc",
110      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset-cff2.cc",
111      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset-input.cc",
112      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset-plan.cc",
113      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset.cc",
114      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ucd.cc",
115      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-unicode.cc",
116      "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-warning.cc",
117    ]
118
119    deps = [ "$ace_flutter_engine_root/icu:ace_libicu_$platform" ]
120  }
121}
122
123foreach(item, ace_platforms) {
124  ace_libharfbuzz("ace_libharfbuzz_" + item.name) {
125    platform = item.name
126    defines = []
127    cflags_cc = []
128    config = {
129    }
130
131    if (defined(item.config)) {
132      config = item.config
133    }
134
135    if (defined(config.defines)) {
136      defines = config.defines
137    }
138
139    if (defined(config.cflags_cc)) {
140      cflags_cc = config.cflags_cc
141    }
142  }
143}
144