• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 Huawei Device Co., Ltd.. All rights reserved.
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(
17    "//foundation/graphic/graphic_2d/rosen/modules/2d_engine/rosen_text/config.gni")
18
19config("rosen_text_config") {
20  cflags_cc = [
21    "-Wno-implicit-fallthrough",
22    "-Os",
23  ]
24  include_dirs = [
25    "$rosen_2d_engine_root",
26    "$flutter_root/engine/flutter/third_party/txt/src",
27    "//third_party_icu/icu4c/source/common",
28  ]
29}
30
31template("rosen_text_properties") {
32  forward_variables_from(invoker, "*")
33
34  ohos_source_set(target_name) {
35    defines += invoker.defines
36    cflags_cc += invoker.cflags_cc
37
38    public_configs = [
39      "$ace_flutter_engine_root/icu:icu_config_$platform",
40      "$ace_flutter_engine_root:flutter_config",
41      ":rosen_text_config",
42    ]
43
44    sources = [
45      "font_collection_txt.cpp",
46      "placeholder_run.cpp",
47      "rosen_converter_txt.cpp",
48      "text_style.cpp",
49      "typography_create_txt.cpp",
50      "typography_style.cpp",
51      "typography_txt.cpp",
52    ]
53
54    public_deps =
55        [ "//third_party/flutter/build/libtxt:thirdparty_lib_txt_$current_os" ]
56  }
57}
58
59foreach(item, ace_platforms) {
60  rosen_text_properties("rosen_text_properties_" + item.name) {
61    platform = item.name
62    defines = []
63    cflags_cc = []
64    config = {
65    }
66
67    if (defined(item.config)) {
68      config = item.config
69    }
70
71    if (defined(config.defines)) {
72      defines = config.defines
73    }
74
75    if (defined(config.cflags_cc)) {
76      cflags_cc = config.cflags_cc
77    }
78  }
79}
80