1# Copyright (c) 2021-2024 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("../../eventhandler.gni")
17if (is_arkui_x) {
18  import("//plugins/events/eventhandler.gni")
19  ohos_source_set("emitter") {
20    include_dirs = [
21      "include",
22      "//third_party/node/src",
23      "//third_party/libuv/include",
24    ]
25    include_dirs += emitter_include
26    sources = [
27      "src/events_emitter.cpp",
28      "src/init.cpp",
29    ]
30  }
31} else {
32  ohos_shared_library("emitter") {
33    sanitize = {
34      integer_overflow = true
35      ubsan = true
36      boundary_sanitize = true
37      cfi = true
38      cfi_cross_dso = true
39      debug = false
40    }
41    branch_protector_ret = "pac_ret"
42
43    include_dirs = [
44      "include",
45      "${inner_api_path}",
46    ]
47
48    sources = [
49      "src/events_emitter.cpp",
50      "src/init.cpp",
51    ]
52
53    deps = [ "${frameworks_path}/eventhandler:libeventhandler" ]
54
55    external_deps = [
56      "c_utils:utils",
57      "hilog:libhilog",
58      "napi:ace_napi",
59    ]
60
61    relative_install_dir = "module/events"
62    subsystem_name = "notification"
63    part_name = "eventhandler"
64  }
65}
66