# Copyright (C) 2022-2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/distributeddatamgr/pasteboard/pasteboard.gni") ohos_shared_library("cj_pasteboard_ffi") { include_dirs = [ "${pasteboard_innerkits_path}/include", "${pasteboard_root_path}/framework/tlv", "${pasteboard_root_path}/framework/uri", "${pasteboard_utils_path}/native/include", "include", ] sanitize = { ubsan = true boundary_sanitize = true cfi = true cfi_cross_dso = true cfi_vcall_icall_only = true debug = false } cflags = [ "-fPIC", "-g3", ] cflags_cc = [ "-fstack-protector", "-D_FORTIFY_SOURCE=2", "-O2", ] if (!defined(defines)) { defines = [] } if (product_name != "ohos-sdk") { deps = [ "${pasteboard_framework_path}:pasteboard_framework", "${pasteboard_root_path}/framework/innerkits:pasteboard_client", ] external_deps = [ "ability_base:want", "ability_base:zuri", "ability_runtime:napi_common", "c_utils:utils", "ffrt:libffrt", "hilog:libhilog", "image_framework:cj_image_ffi", "image_framework:image_native", "ipc:ipc_core", "napi:ace_napi", "napi:cj_bind_ffi", "napi:cj_bind_native", ] sources = [ "src/paste_data_impl.cpp", "src/paste_data_record_impl.cpp", "src/pasteboard_ffi.cpp", "src/system_pasteboard_impl.cpp", ] } else { defines += [ "PREVIEWER" ] sources = [ "src/pasteboard_mock.cpp" ] } if (current_os == "ohos") { defines += [ "OHOS_PLATFORM" ] } if (current_os == "mingw") { defines += [ "WINDOWS_PLATFORM" ] } innerapi_tags = [ "platformsdk" ] subsystem_name = "distributeddatamgr" part_name = "pasteboard" }