• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("//build/ohos.gni")
15import("//build/ohos/ace/ace.gni")
16import("//build/config/components/ets_frontend/ets2abc_config.gni")
17import("../../eventhandler.gni")
18
19ohos_shared_library("eventEmitter") {
20  sanitize = {
21    integer_overflow = true
22    ubsan = true
23    boundary_sanitize = true
24    cfi = true
25    cfi_cross_dso = true
26    debug = false
27  }
28  branch_protector_ret = "pac_ret"
29
30  include_dirs = [
31    "${frameworks_path}/emitter/ani/include",
32    "${frameworks_path}/emitter/napi/include",
33    "${frameworks_path}/emitter/base/include",
34  ]
35
36  sources = [
37    "${frameworks_path}/emitter/ani/src/ani_emitter.cpp",
38    "${frameworks_path}/emitter/ani/src/ani_serialize.cpp",
39    "${frameworks_path}/emitter/ani/src/sts_events_json_common.cpp",
40    "${frameworks_path}/emitter/base/src/ani_async_callback_manager.cpp",
41    "${frameworks_path}/emitter/base/src/ani_deserialize.cpp",
42    "${frameworks_path}/emitter/base/src/async_callback_manager.cpp",
43    "${frameworks_path}/emitter/base/src/napi_async_callback_manager.cpp",
44    "${frameworks_path}/emitter/napi/src/napi_emitter.cpp",
45    "${frameworks_path}/emitter/napi/src/napi_serialize.cpp",
46  ]
47
48  deps = [
49    "${frameworks_path}/eventhandler:libeventhandler",
50    "${frameworks_path}/napi:emitter_interops",
51  ]
52
53  external_deps = [
54    "c_utils:utils",
55    "hilog:libhilog",
56    "napi:ace_napi",
57    "runtime_core:ani",
58  ]
59
60  subsystem_name = "notification"
61  part_name = "eventhandler"
62}
63
64generate_static_abc("event_emitter_abc") {
65  base_url = "${frameworks_path}/emitter/ani/ets"
66  files = [ "${frameworks_path}/emitter/ani/ets/@ohos.events.emitter.ets" ]
67  is_boot_abc = "True"
68  device_dst_file = "/system/framework/event_emitter_abc.abc"
69}
70
71ohos_prebuilt_etc("event_emitter_abc_etc") {
72  source = "$target_out_dir/event_emitter_abc.abc"
73  module_install_dir = "framework"
74  subsystem_name = "notification"
75  part_name = "eventhandler"
76  deps = [ ":event_emitter_abc" ]
77}
78
79generate_static_abc("event_json_abc") {
80  base_url = "${frameworks_path}/emitter/ani/ets"
81  files = [ "${frameworks_path}/emitter/ani/ets/@ohos.events.json.ets" ]
82  is_boot_abc = "True"
83  device_dst_file = "/system/framework/event_json_abc.abc"
84}
85
86ohos_prebuilt_etc("event_json_abc_etc") {
87  source = "$target_out_dir/event_json_abc.abc"
88  module_install_dir = "framework"
89  subsystem_name = "notification"
90  part_name = "eventhandler"
91  deps = [ ":event_json_abc" ]
92}