1# Copyright (C) 2023 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/distributeddatamgr/pasteboard/pasteboard.gni") 16 17ohos_shared_library("pasteboard_napi") { 18 branch_protector_ret = "pac_ret" 19 sanitize = { 20 integer_overflow = true 21 ubsan = true 22 boundary_sanitize = true 23 cfi = true 24 cfi_cross_dso = true 25 debug = false 26 } 27 include_dirs = [ 28 "${pasteboard_innerkits_path}/include", 29 "//foundation/distributeddatamgr/pasteboard/framework/tlv", 30 "//foundation/distributeddatamgr/pasteboard/framework/uri", 31 "napi/include", 32 "${pasteboard_utils_path}/native/include", 33 ] 34 35 version_script = "pasteboard_js_map" 36 cflags = [ 37 "-fPIC", 38 "-g3", 39 ] 40 41 cflags_cc = [ 42 "-D_FORTIFY_SOURCE=2", 43 "-O2", 44 ] 45 46 sources = [ 47 "napi/src/async_call.cpp", 48 "napi/src/napi_data_utils.cpp", 49 "napi/src/napi_init.cpp", 50 "napi/src/napi_pasteboard.cpp", 51 "napi/src/napi_pasteboard_common.cpp", 52 "napi/src/napi_pasteboard_observer.cpp", 53 "napi/src/napi_pasteboard_progress_signal.cpp", 54 "napi/src/napi_pastedata.cpp", 55 "napi/src/napi_pastedata_record.cpp", 56 "napi/src/napi_systempasteboard.cpp", 57 "${pasteboard_service_path}/dfx/src/pasteboard_app_event_dfx.cpp", 58 ] 59 60 deps = [ 61 "${pasteboard_framework_path}:pasteboard_framework", 62 "${pasteboard_innerkits_path}:pasteboard_client", 63 "${pasteboard_innerkits_path}:pasteboard_data", 64 ] 65 66 external_deps = [ 67 "ability_base:want", 68 "ability_base:zuri", 69 "ability_runtime:napi_common", 70 "c_utils:utils", 71 "ffrt:libffrt", 72 "hiappevent:hiappevent_innerapi", 73 "hilog:libhilog", 74 "image_framework:image", 75 "ipc:ipc_single", 76 "json:nlohmann_json_static", 77 "libuv:uv", 78 "napi:ace_napi", 79 "udmf:udmf_client", 80 "udmf:udmf_data_napi", 81 ] 82 83 relative_install_dir = "module" 84 85 subsystem_name = "distributeddatamgr" 86 part_name = "pasteboard" 87} 88