• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2024 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/inner_api/ace_kit/include",
49    "//foundation/arkui/ace_engine/interfaces/native",
50  ]
51
52  public_configs = [ ":ace_ndk_public_configs" ]
53
54  sources = [
55    "//foundation/arkui/ace_engine/frameworks/core/accessibility/native_interface_accessibility_impl.cpp",
56    "//foundation/arkui/ace_engine/frameworks/core/accessibility/native_interface_accessibility_provider.cpp",
57    "//foundation/arkui/ace_engine/frameworks/core/components/common/properties/color.cpp",
58    "//foundation/arkui/ace_engine/frameworks/core/components/xcomponent/native_interface_xcomponent_impl.cpp",
59    "//foundation/arkui/ace_engine/frameworks/core/components_v2/inspector/inspector_constants.cpp",
60    "build_check_for_c.c",
61    "build_check_for_cpp.cpp",
62    "event/drag_and_drop_impl.cpp",
63    "event/key_event_impl.cpp",
64    "event/ui_input_event.cpp",
65    "native_interface_accessibility.cpp",
66    "native_interface_xcomponent.cpp",
67    "native_styled_string_descriptor.cpp",
68    "node/animate_impl.cpp",
69    "node/dialog_model.cpp",
70    "node/dialog_option.cpp",
71    "node/drawable_descriptor.cpp",
72    "node/event_converter.cpp",
73    "node/frame_information.cpp",
74    "node/gesture_impl.cpp",
75    "node/list_option.cpp",
76    "node/native_drawable_descriptor.cpp",
77    "node/native_impl.cpp",
78    "node/native_interface_focus.cpp",
79    "node/native_node_extented.cpp",
80    "node/native_node_napi.cpp",
81    "node/node_adapter_impl.cpp",
82    "node/node_animate.cpp",
83    "node/node_component_snapshot.cpp",
84    "node/node_extened.cpp",
85    "node/node_model.cpp",
86    "node/node_node_relative_container.cpp",
87    "node/node_transition.cpp",
88    "node/node_transition_imp.cpp",
89    "node/node_utils.cpp",
90    "node/progress_option.cpp",
91    "node/style_modifier.cpp",
92    "node/textpicker_option.cpp",
93    "node/waterflow_section_option.cpp",
94  ]
95  external_deps = [ "bounds_checking_function:libsec_shared" ]
96  deps = []
97  cflags_cc = [ "-Wno-missing-braces" ]
98
99  if (target_os == "ohos") {
100    defines = [
101      "OHOS_PLATFORM",
102      "USE_HILOG",
103    ]
104    sources += [ "$ace_root/adapter/ohos/osal/log_wrapper.cpp" ]
105    deps += [
106      ":libace_ndk_rom",
107      "$ace_root/interfaces/inner_api/drawable_descriptor:drawable_descriptor",
108    ]
109    external_deps += [
110      "graphic_2d:native_drawing_ndk",
111      "hilog:libhilog",
112      "image_framework:pixelmap",
113      "napi:ace_napi",
114      "resource_management:global_resmgr",
115      "udmf:libudmf",
116      "udmf:udmf_client",
117    ]
118    version_script =
119        get_label_info(":libace_ndk_rom", "target_gen_dir") + "/" +
120        get_label_info(":libace_ndk_rom", "name") + version_script_suffix
121  } else if (target_os == "android") {
122    sources += [ "$ace_root/adapter/android/osal/log_wrapper.cpp" ]
123    libs = [ "log" ]
124  }
125
126  subsystem_name = ace_engine_subsystem
127  part_name = ace_engine_part
128}
129
130if (is_arkui_x) {
131  ohos_source_set("ace_static_ndk") {
132    include_dirs = [
133      "$ace_root",
134      "$ace_root/frameworks",
135      "$ace_root/interfaces/native",
136      "$ace_root/interfaces/inner_api/ace_kit/include",
137    ]
138
139    sources = [
140      "$ace_root/frameworks/core/components/xcomponent/native_interface_xcomponent_impl.cpp",
141      "native_interface_xcomponent.cpp",
142    ]
143
144    deps = [ "//third_party/bounds_checking_function:libsec_static" ]
145
146    cflags_cc = [ "-Wno-missing-braces" ]
147
148    print("ace_static_ndk build.")
149    subsystem_name = ace_engine_subsystem
150    part_name = ace_engine_part
151  }
152}
153
154group("ace_packages_ndk") {
155  deps = [ ":ace_ndk" ]
156}
157