• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2025 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")
16
17if (!is_arkui_x) {
18  ohos_ndk_headers("ace_header") {
19    dest_dir = "$ndk_headers_out_dir/ace/xcomponent/"
20    sources = [
21      "native_interface_xcomponent.h",
22      "native_xcomponent_key_event.h",
23    ]
24  }
25
26  ohos_ndk_library("libace_ndk_rom") {
27    ndk_description_file = "./libace.ndk.json"
28    min_compact_version = "7"
29    output_name = "ace_ndk"
30  }
31}
32
33config("ace_ndk_public_configs") {
34  include_dirs = [ "$ace_root/interfaces" ]
35}
36
37ohos_shared_library("ace_ndk") {
38  if (current_os == "ohos") {
39    sanitize = {
40      integer_overflow = true
41      boundary_sanitize = true
42      debug = ace_sanitize_debug
43    }
44  }
45  include_dirs = [
46    "//foundation/arkui/ace_engine",
47    "//foundation/arkui/ace_engine/frameworks",
48    "//foundation/arkui/ace_engine/interfaces/native",
49  ]
50
51  public_configs = [ ":ace_ndk_public_configs" ]
52
53  sources = [
54    "//foundation/arkui/ace_engine/frameworks/core/accessibility/native_interface_accessibility_impl.cpp",
55    "//foundation/arkui/ace_engine/frameworks/core/accessibility/native_interface_accessibility_provider.cpp",
56    "//foundation/arkui/ace_engine/frameworks/core/components/common/properties/color.cpp",
57    "//foundation/arkui/ace_engine/frameworks/core/components/xcomponent/native_interface_xcomponent_impl.cpp",
58    "//foundation/arkui/ace_engine/frameworks/core/components_v2/inspector/inspector_constants.cpp",
59    "event/drag_and_drop_impl.cpp",
60    "event/key_event_impl.cpp",
61    "event/ui_input_event.cpp",
62    "native_interface_accessibility.cpp",
63    "native_interface_xcomponent.cpp",
64    "native_styled_string_descriptor.cpp",
65    "node/animate_impl.cpp",
66    "node/dialog_model.cpp",
67    "node/drawable_descriptor.cpp",
68    "node/event_converter.cpp",
69    "node/frame_information.cpp",
70    "node/gesture_impl.cpp",
71    "node/list_option.cpp",
72    "node/native_drawable_descriptor.cpp",
73    "node/native_impl.cpp",
74    "node/native_interface_focus.cpp",
75    "node/native_node_extented.cpp",
76    "node/native_node_napi.cpp",
77    "node/node_adapter_impl.cpp",
78    "node/node_animate.cpp",
79    "node/node_component_snapshot.cpp",
80    "node/node_extened.cpp",
81    "node/node_model.cpp",
82    "node/node_node_relative_container.cpp",
83    "node/node_transition.cpp",
84    "node/node_transition_imp.cpp",
85    "node/node_utils.cpp",
86    "node/progress_option.cpp",
87    "node/style_modifier.cpp",
88    "node/waterflow_section_option.cpp",
89  ]
90  external_deps = [ "bounds_checking_function:libsec_shared" ]
91  deps = []
92  cflags_cc = [ "-Wno-missing-braces" ]
93
94  if (target_os == "ohos") {
95    defines = [
96      "OHOS_PLATFORM",
97      "USE_HILOG",
98    ]
99    sources += [ "$ace_root/adapter/ohos/osal/log_wrapper.cpp" ]
100    deps += [
101      ":libace_ndk_rom",
102      "$ace_root/interfaces/inner_api/drawable_descriptor:drawable_descriptor",
103    ]
104    external_deps += [
105      "graphic_2d:native_drawing_ndk",
106      "hilog:libhilog",
107      "image_framework:pixelmap",
108      "napi:ace_napi",
109      "udmf:libudmf",
110      "udmf:udmf_client",
111    ]
112    version_script =
113        get_label_info(":libace_ndk_rom", "target_gen_dir") + "/" +
114        get_label_info(":libace_ndk_rom", "name") + version_script_suffix
115  } else if (target_os == "android") {
116    sources += [ "$ace_root/adapter/android/osal/log_wrapper.cpp" ]
117    libs = [ "log" ]
118  }
119
120  subsystem_name = ace_engine_subsystem
121  part_name = ace_engine_part
122}
123
124if (is_arkui_x) {
125  ohos_source_set("ace_static_ndk") {
126    include_dirs = [
127      "$ace_root",
128      "$ace_root/frameworks",
129      "$ace_root/interfaces/native",
130    ]
131
132    sources = [
133      "$ace_root/frameworks/core/components/xcomponent/native_interface_xcomponent_impl.cpp",
134      "native_interface_xcomponent.cpp",
135    ]
136
137    deps = [ "//third_party/bounds_checking_function:libsec_static" ]
138
139    cflags_cc = [ "-Wno-missing-braces" ]
140
141    print("ace_static_ndk build.")
142    subsystem_name = ace_engine_subsystem
143    part_name = ace_engine_part
144  }
145}
146
147group("ace_packages_ndk") {
148  deps = [ ":ace_ndk" ]
149}
150