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") 17 18config("public_emitter_config") { 19 include_dirs = [ "include" ] 20} 21 22if (is_arkui_x) { 23 import("//plugins/events/eventhandler.gni") 24 ohos_source_set("emitter") { 25 include_dirs = [ 26 "include", 27 "//third_party/node/src", 28 "//third_party/libuv/include", 29 ] 30 include_dirs += emitter_include 31 defines = ["CROSS_PLATFORM"] 32 sources = [ 33 "src/events_emitter.cpp", 34 "src/init.cpp", 35 "src/interops.cpp", 36 ] 37 } 38} else { 39 ohos_shared_library("emitter") { 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 sources = [ 51 "src/init.cpp", 52 ] 53 54 deps = [ "${frameworks_path}/napi:emitter_interops" ] 55 56 external_deps = [ 57 "c_utils:utils", 58 "napi:ace_napi", 59 ] 60 61 relative_install_dir = "module/events" 62 subsystem_name = "notification" 63 part_name = "eventhandler" 64 } 65 66 ohos_shared_library("emitter_interops") { 67 sanitize = { 68 integer_overflow = true 69 ubsan = true 70 boundary_sanitize = true 71 cfi = true 72 cfi_cross_dso = true 73 debug = false 74 } 75 branch_protector_ret = "pac_ret" 76 version_script = "libemitter.map" 77 78 include_dirs = [ 79 "include", 80 "${inner_api_path}", 81 ] 82 83 public_configs = [ ":public_emitter_config" ] 84 85 sources = [ 86 "src/events_emitter.cpp", 87 "src/interops.cpp" 88 ] 89 90 deps = [ "${frameworks_path}/eventhandler:libeventhandler" ] 91 92 external_deps = [ 93 "c_utils:utils", 94 "hilog:libhilog", 95 "napi:ace_napi", 96 ] 97 98 subsystem_name = "notification" 99 part_name = "eventhandler" 100 } 101}