# Copyright (c) 2021-2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/arkui/ace_engine/ace_config.gni") if (!is_arkui_x) { ohos_ndk_headers("ace_header") { dest_dir = "$ndk_headers_out_dir/ace/xcomponent/" sources = [ "native_interface_xcomponent.h", "native_xcomponent_key_event.h", ] } ohos_ndk_library("libace_ndk_rom") { ndk_description_file = "./libace.ndk.json" min_compact_version = "7" output_name = "ace_ndk" } } config("ace_ndk_public_configs") { include_dirs = [ "$ace_root/interfaces" ] } ohos_shared_library("ace_ndk") { if (current_os == "ohos") { sanitize = { integer_overflow = true boundary_sanitize = true debug = ace_sanitize_debug } } include_dirs = [ "//foundation/arkui/ace_engine", "//foundation/arkui/ace_engine/frameworks", "//foundation/arkui/ace_engine/interfaces/native", ] public_configs = [ ":ace_ndk_public_configs" ] sources = [ "//foundation/arkui/ace_engine/frameworks/core/accessibility/native_interface_accessibility_impl.cpp", "//foundation/arkui/ace_engine/frameworks/core/accessibility/native_interface_accessibility_provider.cpp", "//foundation/arkui/ace_engine/frameworks/core/components/common/properties/color.cpp", "//foundation/arkui/ace_engine/frameworks/core/components/xcomponent/native_interface_xcomponent_impl.cpp", "//foundation/arkui/ace_engine/frameworks/core/components_v2/inspector/inspector_constants.cpp", "event/drag_and_drop_impl.cpp", "event/key_event_impl.cpp", "event/ui_input_event.cpp", "native_interface_accessibility.cpp", "native_interface_xcomponent.cpp", "native_styled_string_descriptor.cpp", "node/animate_impl.cpp", "node/dialog_model.cpp", "node/drawable_descriptor.cpp", "node/event_converter.cpp", "node/frame_information.cpp", "node/gesture_impl.cpp", "node/list_option.cpp", "node/native_drawable_descriptor.cpp", "node/native_impl.cpp", "node/native_node_extented.cpp", "node/native_node_napi.cpp", "node/node_adapter_impl.cpp", "node/node_animate.cpp", "node/node_extened.cpp", "node/node_model.cpp", "node/node_node_relative_container.cpp", "node/node_transition.cpp", "node/node_transition_imp.cpp", "node/node_utils.cpp", "node/style_modifier.cpp", "node/waterflow_section_option.cpp", ] external_deps = [ "bounds_checking_function:libsec_shared" ] deps = [] cflags_cc = [ "-Wno-missing-braces" ] if (target_os == "ohos") { defines = [ "OHOS_PLATFORM", "USE_HILOG", ] sources += [ "$ace_root/adapter/ohos/osal/log_wrapper.cpp" ] deps += [ ":libace_ndk_rom", "$ace_root/interfaces/inner_api/drawable_descriptor:drawable_descriptor", ] external_deps += [ "graphic_2d:native_drawing_ndk", "hilog:libhilog", "image_framework:pixelmap", "napi:ace_napi", "udmf:udmf_client", ] version_script = get_label_info(":libace_ndk_rom", "target_gen_dir") + "/" + get_label_info(":libace_ndk_rom", "name") + version_script_suffix } else if (target_os == "android") { sources += [ "$ace_root/adapter/android/osal/log_wrapper.cpp" ] libs = [ "log" ] } subsystem_name = ace_engine_subsystem part_name = ace_engine_part } if (is_arkui_x) { ohos_source_set("ace_static_ndk") { include_dirs = [ "$ace_root", "$ace_root/frameworks", "$ace_root/interfaces/native", ] sources = [ "$ace_root/frameworks/core/components/xcomponent/native_interface_xcomponent_impl.cpp", "native_interface_xcomponent.cpp", ] deps = [ "//third_party/bounds_checking_function:libsec_static" ] cflags_cc = [ "-Wno-missing-braces" ] print("ace_static_ndk build.") subsystem_name = ace_engine_subsystem part_name = ace_engine_part } } group("ace_packages_ndk") { deps = [ ":ace_ndk" ] }