• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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/graphic/graphic_2d/frameworks/text/config.gni")
16import("//foundation/graphic/graphic_2d/graphic_config.gni")
17
18## Build libtexgine.so {{{
19config("libtexgine_config") {
20  visibility = [ ":*" ]
21
22  cflags = [
23    "-Wall",
24    "-Werror",
25    "-std=c++17",
26  ]
27
28  include_dirs = [ "$rosen_text_root" ]
29}
30
31if (defined(is_arkui_x) && is_arkui_x) {
32  config("libtexgine_public_config") {
33    include_dirs = [
34      "//third_party/icu/icu4c/source/common",
35      "$graphic_2d_root/rosen/modules/render_service_base/include",
36      "$graphic_2d_root/rosen/modules/2d_graphics/src/drawing/engine_adapter",
37      "$graphic_2d_root/rosen/modules/2d_graphics/include",
38      "$graphic_2d_root/rosen/modules/2d_graphics/src",
39      "$rosen_text_root/interface/export/rosen_text",
40    ]
41  }
42} else {
43  config("libtexgine_public_config") {
44    include_dirs = [
45      "$graphic_2d_root/rosen/modules/render_service_base/include",
46      "$graphic_2d_root/rosen/modules/2d_graphics/src/drawing/engine_adapter",
47      "$graphic_2d_root/rosen/modules/2d_graphics/include",
48      "$graphic_2d_root/rosen/modules/2d_graphics/src",
49      "$rosen_text_root/interface/export/rosen_text",
50    ]
51  }
52}
53
54ohos_source_set("libtexgine_source") {
55  sources = [
56    "src/font_config.cpp",
57    "src/font_descriptor_cache.cpp",
58    "src/font_descriptor_mgr.cpp",
59    "src/font_parser.cpp",
60    "src/opentype_parser/opentype_basic_type.cpp",
61  ]
62
63  configs = [
64    ":libtexgine_config",
65    "//build/config/compiler:exceptions",
66    "//build/config/compiler:rtti",
67  ]
68
69  public_configs = [ ":libtexgine_public_config" ]
70
71  public_deps = []
72  defines = []
73
74  if (rs_enable_gpu) {
75    defines += [ "RS_ENABLE_GPU" ]
76  }
77  if (is_arkui_x) {
78    include_dirs = [ "//base/hiviewdfx/hitrace/interfaces/native/innerkits/include/hitrace_meter" ]
79    defines += [ "CROSS_PLATFORM" ]
80    public_deps += [
81      "//third_party/jsoncpp:jsoncpp_static",
82      "//third_party/skia:skia_$platform",
83    ]
84    deps = [
85      "//third_party/bounds_checking_function:libsec_static",
86      "//third_party/cJSON:cjson_static",
87    ]
88  } else {
89    external_deps = [
90      "bounds_checking_function:libsec_shared",
91      "cJSON:cjson",
92      "skia:skia_canvaskit",
93    ]
94  }
95
96  if (platform_is_ohos) {
97    defines += [
98      "BUILD_NON_SDK_VER",
99      "ENABLE_OHOS_ENHANCE",
100    ]
101
102    external_deps += [
103      "c_utils:utils",
104      "hilog:libhilog",
105      "hitrace:hitrace_meter",
106      "icu:shared_icuuc",
107      "init:libbegetutil",
108    ]
109  }
110
111  part_name = "graphic_2d"
112  subsystem_name = "graphic"
113}
114