• 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/graphic_config.gni")
16
17## Build libtexgine.so {{{
18config("libtexgine_config") {
19  visibility = [ ":*" ]
20
21  cflags = [
22    "-Wall",
23    "-Werror",
24    "-g3",
25    "-std=c++17",
26  ]
27
28  include_dirs = [ "src" ]
29}
30
31if (defined(is_arkui_x) && is_arkui_x) {
32  config("libtexgine_public_config") {
33    include_dirs = [
34      "export",
35      "texgine_drawing",
36      "//third_party/icu/icu4c/source/common",
37      "$graphic_2d_root/rosen/modules/render_service_base/include",
38      "$graphic_2d_root/rosen/modules/2d_graphics/src/drawing/engine_adapter",
39      "$graphic_2d_root/rosen/modules/2d_graphics/include",
40      "$graphic_2d_root/rosen/modules/2d_graphics/src",
41      "$graphic_2d_root/rosen/modules/2d_engine/rosen_text/export/rosen_text",
42    ]
43  }
44} else {
45  config("libtexgine_public_config") {
46    include_dirs = [
47      "$graphic_2d_root/rosen/modules/render_service_base/include",
48      "$graphic_2d_root/rosen/modules/2d_graphics/src/drawing/engine_adapter",
49      "$graphic_2d_root/rosen/modules/2d_graphics/include",
50      "$graphic_2d_root/rosen/modules/2d_graphics/src",
51      "$graphic_2d_root/rosen/modules/2d_engine/rosen_text/export/rosen_text",
52    ]
53  }
54}
55
56ohos_source_set("libtexgine_source") {
57  sources = [
58    "src/font_config.cpp",
59    "src/font_descriptor_cache.cpp",
60    "src/font_descriptor_mgr.cpp",
61    "src/font_parser.cpp",
62    "src/opentype_parser/opentype_basic_type.cpp",
63  ]
64
65  configs = [
66    ":libtexgine_config",
67    "//build/config/compiler:exceptions",
68    "//build/config/compiler:rtti",
69  ]
70
71  public_configs = [ ":libtexgine_public_config" ]
72
73  platform = current_os
74  if (platform == "mingw") {
75    platform = "windows"
76  }
77
78  public_deps = []
79
80  defines = []
81  if (is_arkui_x) {
82    defines += [ "CROSS_PLATFORM" ]
83    public_deps += [
84      "//third_party/jsoncpp:jsoncpp_static",
85      "//third_party/skia:skia_$platform",
86    ]
87  }
88  if (defined(use_rosen_drawing) && use_rosen_drawing) {
89    defines += [ "USE_ROSEN_DRAWING" ]
90    if (rs_enable_gpu) {
91      defines += [ "RS_ENABLE_GPU" ]
92    }
93  }
94  if (is_arkui_x) {
95    deps = [ "//third_party/bounds_checking_function:libsec_static" ]
96    deps += [ "//third_party/cJSON:cjson_static" ]
97  } else {
98    external_deps = [
99      "bounds_checking_function:libsec_static",
100      "cJSON:cjson_static",
101    ]
102  }
103
104  if (platform == "ohos") {
105    defines += [
106      "BUILD_NON_SDK_VER",
107      "OHOS_TEXT_ENABLE",
108    ]
109
110    if (logger_enable_scope) {
111      defines += [ "LOGGER_ENABLE_SCOPE" ]
112    }
113
114    if (texgine_enable_debug_log) {
115      defines += [ "TEXGINE_ENABLE_DEBUGLOG" ]
116    }
117
118    external_deps += [
119      "c_utils:utils",
120      "hilog:libhilog",
121      "hitrace:hitrace_meter",
122      "icu:shared_icuuc",
123    ]
124  } else {
125    if (platform == "mac") {
126      defines += [ "BUILD_SDK_MAC" ]
127    }
128    if (platform == "android") {
129      defines += [ "BUILD_SDK_ANDROID" ]
130    }
131    if (platform == "ios") {
132      defines += [ "BUILD_SDK_IOS" ]
133    }
134  }
135
136  part_name = "graphic_2d"
137  subsystem_name = "graphic"
138}
139