• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 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    "event/drag_and_drop_impl.cpp",
59    "event/ui_input_event.cpp",
60    "native_interface_accessibility.cpp",
61    "native_interface_xcomponent.cpp",
62    "node/animate_impl.cpp",
63    "node/dialog_model.cpp",
64    "node/drawable_descriptor.cpp",
65    "node/event_converter.cpp",
66    "node/frame_information.cpp",
67    "node/gesture_impl.cpp",
68    "node/list_option.cpp",
69    "node/native_drawable_descriptor.cpp",
70    "node/native_impl.cpp",
71    "node/native_node_extented.cpp",
72    "node/native_node_napi.cpp",
73    "node/node_adapter_impl.cpp",
74    "node/node_animate.cpp",
75    "node/node_extened.cpp",
76    "node/node_model.cpp",
77    "node/node_node_relative_container.cpp",
78    "node/node_transition.cpp",
79    "node/node_transition_imp.cpp",
80    "node/node_utils.cpp",
81    "node/style_modifier.cpp",
82    "node/waterflow_section_option.cpp",
83  ]
84  external_deps = [ "bounds_checking_function:libsec_shared" ]
85  deps = []
86  cflags_cc = [ "-Wno-missing-braces" ]
87
88  if (target_os == "ohos") {
89    defines = [
90      "OHOS_PLATFORM",
91      "USE_HILOG",
92    ]
93    sources += [ "$ace_root/adapter/ohos/osal/log_wrapper.cpp" ]
94    deps += [
95      ":libace_ndk_rom",
96      "$ace_root/interfaces/inner_api/drawable_descriptor:drawable_descriptor",
97    ]
98    external_deps += [
99      "graphic_2d:native_drawing_ndk",
100      "hilog:libhilog",
101      "image_framework:pixelmap",
102      "napi:ace_napi",
103      "udmf:udmf_client",
104    ]
105    version_script =
106        get_label_info(":libace_ndk_rom", "target_gen_dir") + "/" +
107        get_label_info(":libace_ndk_rom", "name") + version_script_suffix
108  } else if (target_os == "android") {
109    sources += [ "$ace_root/adapter/android/osal/log_wrapper.cpp" ]
110    libs = [ "log" ]
111  }
112
113  subsystem_name = ace_engine_subsystem
114  part_name = ace_engine_part
115}
116
117if (is_arkui_x) {
118  ohos_source_set("ace_static_ndk") {
119    include_dirs = [
120      "$ace_root",
121      "$ace_root/frameworks",
122      "$ace_root/interfaces/native",
123    ]
124
125    sources = [
126      "$ace_root/frameworks/core/components/xcomponent/native_interface_xcomponent_impl.cpp",
127      "native_interface_xcomponent.cpp",
128    ]
129
130    deps = [ "$checking_function_root:libsec_static" ]
131
132    cflags_cc = [ "-Wno-missing-braces" ]
133
134    print("ace_static_ndk build.")
135    subsystem_name = ace_engine_subsystem
136    part_name = ace_engine_part
137  }
138}
139
140group("ace_packages_ndk") {
141  deps = [ ":ace_ndk" ]
142}
143