1# Copyright (c) 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("//base/notification/common_event_service/event.gni") 15import("//build/config/components/ets_frontend/ets2abc_config.gni") 16import("//build/ohos.gni") 17 18cflags = [ 19 "-fno-math-errno", 20 "-fno-unroll-loops", 21 "-fmerge-all-constants", 22 "-fno-ident", 23 "-Oz", 24 "-flto", 25 "-ffunction-sections", 26 "-fdata-sections", 27] 28 29config("native_module_config") { 30 visibility = [ ":*" ] 31 32 include_dirs = [] 33 34 if (target_cpu == "arm") { 35 cflags += [ "-DBINDER_IPC_32BIT" ] 36 } 37} 38 39ohos_shared_library("ani_commoneventmanager") { 40 sanitize = { 41 integer_overflow = true 42 ubsan = true 43 boundary_sanitize = true 44 cfi = true 45 cfi_cross_dso = true 46 debug = false 47 } 48 branch_protector_ret = "pac_ret" 49 50 include_dirs = [ 51 "${interfaces_path}/kits/ani/common_event/include", 52 "${ces_core_path}/include", 53 ] 54 55 configs = [ ":native_module_config" ] 56 57 sources = [ 58 "src/ani_common_event.cpp", 59 "src/ani_common_event_utils.cpp", 60 ] 61 62 deps = [ "${ces_native_path}:cesfwk_innerkits" ] 63 64 external_deps = [ 65 "ability_base:want", 66 "ability_runtime:ani_common", 67 "ability_runtime:runtime", 68 "c_utils:utils", 69 "hilog:libhilog", 70 "napi:ace_napi", 71 "runtime_core:ani", 72 ] 73 74 subsystem_name = "notification" 75 part_name = "common_event_service" 76} 77 78generate_static_abc("common_event_manager") { 79 base_url = "./ets" 80 files = [ "./ets/@ohos.commonEventManager.ets" ] 81 is_boot_abc = "True" 82 device_dst_file = "/system/framework/common_event_manager.abc" 83} 84 85ohos_prebuilt_etc("common_event_manager_etc") { 86 source = "$target_out_dir/common_event_manager.abc" 87 module_install_dir = "framework" 88 subsystem_name = "notification" 89 part_name = "common_event_service" 90 deps = [ ":common_event_manager" ] 91} 92 93generate_static_abc("commonEventData") { 94 base_url = "./ets" 95 files = [ "./ets/commonEvent/commonEventData.ets" ] 96 is_boot_abc = "True" 97 device_dst_file = "/system/framework/commonEventData.abc" 98} 99 100ohos_prebuilt_etc("commonEventData_etc") { 101 source = "$target_out_dir/commonEventData.abc" 102 module_install_dir = "framework" 103 subsystem_name = "notification" 104 part_name = "common_event_service" 105 deps = [ ":commonEventData" ] 106} 107 108generate_static_abc("commonEventPublishData") { 109 base_url = "./ets" 110 files = [ "./ets/commonEvent/commonEventPublishData.ets" ] 111 is_boot_abc = "True" 112 device_dst_file = "/system/framework/commonEventPublishData.abc" 113} 114 115ohos_prebuilt_etc("commonEventPublishData_etc") { 116 source = "$target_out_dir/commonEventPublishData.abc" 117 module_install_dir = "framework" 118 subsystem_name = "notification" 119 part_name = "common_event_service" 120 deps = [ ":commonEventPublishData" ] 121} 122 123generate_static_abc("commonEventSubscribeInfo") { 124 base_url = "./ets" 125 files = [ "./ets/commonEvent/commonEventSubscribeInfo.ets" ] 126 is_boot_abc = "True" 127 device_dst_file = "/system/framework/commonEventSubscribeInfo.abc" 128} 129 130ohos_prebuilt_etc("commonEventSubscribeInfo_etc") { 131 source = "$target_out_dir/commonEventSubscribeInfo.abc" 132 module_install_dir = "framework" 133 subsystem_name = "notification" 134 part_name = "common_event_service" 135 deps = [ ":commonEventSubscribeInfo" ] 136} 137 138generate_static_abc("commonEventSubscriber") { 139 base_url = "./ets" 140 files = [ "./ets/commonEvent/commonEventSubscriber.ets" ] 141 is_boot_abc = "True" 142 device_dst_file = "/system/framework/commonEventSubscriber.abc" 143} 144 145ohos_prebuilt_etc("commonEventSubscriber_etc") { 146 source = "$target_out_dir/commonEventSubscriber.abc" 147 module_install_dir = "framework" 148 subsystem_name = "notification" 149 part_name = "common_event_service" 150 deps = [ ":commonEventSubscriber" ] 151} 152 153generate_static_abc("static_subscriber_extension_ability") { 154 base_url = "./ets" 155 files = [ "./ets/@ohos.application.StaticSubscriberExtensionAbility.ets" ] 156 is_boot_abc = "True" 157 device_dst_file = "/system/framework/static_subscriber_extension_ability.abc" 158} 159 160ohos_prebuilt_etc("static_subscriber_extension_ability_abc_etc") { 161 source = "$target_out_dir/static_subscriber_extension_ability.abc" 162 module_install_dir = "framework" 163 subsystem_name = "notification" 164 part_name = "common_event_service" 165 deps = [ ":static_subscriber_extension_ability" ] 166} 167 168generate_static_abc("static_subscriber_extension_context") { 169 base_url = "./ets" 170 files = [ "./ets/@ohos.application.StaticSubscriberExtensionContext.ets" ] 171 is_boot_abc = "True" 172 device_dst_file = "/system/framework/static_subscriber_extension_context.abc" 173} 174 175ohos_prebuilt_etc("static_subscriber_extension_context_abc_etc") { 176 source = "$target_out_dir/static_subscriber_extension_context.abc" 177 module_install_dir = "framework" 178 subsystem_name = "notification" 179 part_name = "common_event_service" 180 deps = [ ":static_subscriber_extension_context" ] 181} 182