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") 16import("//foundation/arkui/ace_engine/build/ace_ext.gni") 17 18# build static 19template("ace_osal_ohos_source_set") { 20 forward_variables_from(invoker, "*") 21 22 ohos_source_set(target_name) { 23 subsystem_name = ace_engine_subsystem 24 part_name = ace_engine_part 25 defines += invoker.defines 26 if ("${product_name}" == "ohcore") { 27 defines += [ "EXT_SURFACE_ENABLE" ] 28 } 29 if (is_standard_system) { 30 external_deps = [ 31 "hitrace_native:hitrace_meter", 32 "hiviewdfx_hilog_native:libhilog", 33 "init:libbeget_proxy", 34 "init:libbegetutil", 35 ] 36 configs = [ "$ace_root:ace_config" ] 37 } else { 38 external_deps = [ 39 "hilog:libhilog", 40 "hitrace_native:hitrace_meter", 41 "init_lite:libbegetutil", 42 ] 43 44 configs = [ "$ace_root:ace_config" ] 45 } 46 include_dirs = [ 47 "$ability_runtime_napi_path/inner/napi_common", 48 "//base/hiviewdfx/hicollie/interfaces/native/innerkits/include", 49 "//commonlibrary/c_utils/base/include", 50 "//foundation/window/window_manager/interfaces/innerkits", 51 ] 52 53 sources = [ 54 "ace_engine_ext.cpp", 55 "ace_trace.cpp", 56 "anr_thread.cpp", 57 "event_report.cpp", 58 "exception_handler.cpp", 59 "frame_report.cpp", 60 "layout_inspector.cpp", 61 "log_wrapper.cpp", 62 "ressched_report.cpp", 63 "system_properties.cpp", 64 "trace_id_impl.cpp", 65 "want_wrap_ohos.cpp", 66 ] 67 68 public_deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] 69 70 if (is_standard_system) { 71 sources += [ 72 "resource_adapter_impl.cpp", 73 "resource_convertor.cpp", 74 "resource_theme_style.cpp", 75 ] 76 deps = [ 77 "$ability_runtime_path/frameworks/native/ability/native:abilitykit_native", 78 "$ace_flutter_engine_root/icu:ace_libicu_ohos", 79 ] 80 public_deps += [ 81 "//base/global/resource_management/frameworks/resmgr:global_resmgr", 82 ] 83 external_deps += [ 84 "ability_base:want", 85 "input:libmmi-client", 86 "multimedia_image_framework:image", 87 "napi:ace_napi", 88 ] 89 if (defined(config.accessibility_support) && 90 config.accessibility_support) { 91 sources += [ "js_accessibility_manager.cpp" ] 92 deps += [ "$ace_root/frameworks/bridge/common/accessibility:bridge_accessibility_ohos" ] 93 external_deps += [ 94 "ability_runtime:ability_manager", 95 "accessibility:accessibilityclient", 96 "accessibility:accessibilityconfig", 97 ] 98 } else { 99 sources += [ "fake_accessibility_manager.cpp" ] 100 } 101 if (frame_trace_support) { 102 include_dirs += [ "//foundation/resourceschedule/frame_aware_sched/interfaces/innerkits/frameintf" ] 103 sources += [ "frame_trace_adapter_impl.cpp" ] 104 deps += [ "//foundation/resourceschedule/frame_aware_sched/interfaces/innerkits/frameintf:frame_trace_intf" ] 105 } else { 106 sources += [ "frame_trace_adapter_fake_impl.cpp" ] 107 } 108 } else { 109 external_deps += [ "multimedia_image:image" ] 110 } 111 sources += [ 112 "image_source_ohos.cpp", 113 "mouse_style_ohos.cpp", 114 "page_url_checker_ohos.cpp", 115 "pixel_map_ohos.cpp", 116 ] 117 external_deps += [ 118 "ability_runtime:abilitykit_native", 119 "ability_runtime:runtime", 120 "bundle_framework:appexecfwk_core", 121 "hicollie_native:libhicollie", 122 "hisysevent_native:libhisysevent", 123 "hitrace_native:libhitracechain", 124 ] 125 deps += [ "//foundation/graphic/graphic_2d/rosen/modules/frame_analyzer:libframe_analyzer" ] 126 } 127} 128 129foreach(item, ace_platforms) { 130 platform = item.name 131 if (platform == "ohos") { 132 ace_osal_ohos_source_set("ace_osal_ohos") { 133 defines = [] 134 config = { 135 } 136 137 if (defined(item.config)) { 138 config = item.config 139 } 140 if (defined(config.defines)) { 141 defines = config.defines 142 } 143 } 144 } 145} 146