• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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/graphic/graphic_2d/ace_platforms.gni")
16import("//foundation/graphic/graphic_2d/frameworks/text/config.gni")
17import("//foundation/graphic/graphic_2d/graphic_config.gni")
18
19ohos_source_set("text_ndk") {
20  sanitize = {
21    cfi = true
22    cfi_cross_dso = true
23    cfi_vcall_icall_only = true
24    debug = false
25  }
26
27  include_dirs = [
28    "$graphic_2d_root/rosen/modules/render_service_base/include",
29    "$graphic_2d_root/rosen/modules/render_service_base/src",
30    "$graphic_2d_root/frameworks/text/service/global_config",
31    "$rosen_root/modules/2d_graphics/drawing_ndk/include",
32    "$rosen_text_root",
33    "$rosen_text_root/adapter",
34    "$rosen_text_root/interface/export",
35    "$rosen_text_root/interface/export/ndk_include",
36    "$rosen_text_root/service",
37    "$rosen_text_root/service/texgine/src",
38  ]
39  deps = [
40    "$rosen_root/modules/2d_graphics:2d_graphics",
41    "$rosen_text_root:rosen_text",
42  ]
43  sources = [
44    "drawing_font_manager/drawing_font_collection.cpp",
45    "drawing_font_manager/drawing_font_mgr.cpp",
46    "drawing_font_manager/drawing_register_font.cpp",
47    "drawing_font_manager/drawing_text_font_descriptor.cpp",
48    "drawing_font_manager/font_utils.cpp",
49    "drawing_typography/drawing_text_global.cpp",
50    "drawing_typography/drawing_text_line.cpp",
51    "drawing_typography/drawing_text_lineTypography.cpp",
52    "drawing_typography/drawing_text_run.cpp",
53    "drawing_typography/drawing_text_typography.cpp",
54  ]
55
56  if (ohos_indep_compiler_enable) {
57    include_dirs +=
58        [ "//binarys/third_party/icu/innerapis/shared_icuuc/includes/common" ]
59  }
60  defines = []
61  if (use_skia_txt) {
62    defines += [ "USE_SKIA_TXT" ]
63    include_dirs += [ "$rosen_text_root/adapter/skia" ]
64  }
65  if (is_arkui_x) {
66    defines += [ "CROSS_PLATFORM" ]
67  }
68  if (rs_enable_gpu) {
69    defines += [ "RS_ENABLE_GPU" ]
70  }
71
72  external_deps = [ "bounds_checking_function:libsec_shared" ]
73
74  if (platform_is_ohos) {
75    external_deps += [
76      "c_utils:utils",
77      "hilog:libhilog",
78      "icu:shared_icuuc",
79    ]
80  } else {
81    cflags_cc = [ "-std=c++17" ]
82    deps += [ "$rosen_root/modules/platform:hilog" ]
83    defines += [ "MODULE_DRAWING" ]
84    external_deps += [ "skia:skia_canvaskit" ]
85  }
86  part_name = "graphic_2d"
87  subsystem_name = "graphic"
88}
89