• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2022-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("cj_pasteboard_ffi") {
18  include_dirs = [
19    "${pasteboard_innerkits_path}/include",
20    "${pasteboard_root_path}/framework/tlv",
21    "${pasteboard_root_path}/framework/uri",
22    "${pasteboard_utils_path}/native/include",
23    "include",
24  ]
25
26  sanitize = {
27    ubsan = true
28    boundary_sanitize = true
29    cfi = true
30    cfi_cross_dso = true
31    cfi_vcall_icall_only = true
32    debug = false
33  }
34
35  cflags = [
36    "-fPIC",
37    "-g3",
38  ]
39
40  cflags_cc = [
41    "-fstack-protector",
42    "-D_FORTIFY_SOURCE=2",
43    "-O2",
44  ]
45
46  if (!defined(defines)) {
47    defines = []
48  }
49
50  if (product_name != "ohos-sdk") {
51    deps = [
52      "${pasteboard_framework_path}:pasteboard_framework",
53      "${pasteboard_root_path}/framework/innerkits:pasteboard_client",
54    ]
55    external_deps = [
56      "ability_base:want",
57      "ability_base:zuri",
58      "ability_runtime:napi_common",
59      "c_utils:utils",
60      "ffrt:libffrt",
61      "hilog:libhilog",
62      "image_framework:cj_image_ffi",
63      "image_framework:image_native",
64      "ipc:ipc_core",
65      "napi:ace_napi",
66      "napi:cj_bind_ffi",
67      "napi:cj_bind_native",
68    ]
69    sources = [
70      "src/paste_data_impl.cpp",
71      "src/paste_data_record_impl.cpp",
72      "src/pasteboard_ffi.cpp",
73      "src/system_pasteboard_impl.cpp",
74    ]
75  } else {
76    defines += [ "PREVIEWER" ]
77    sources = [ "src/pasteboard_mock.cpp" ]
78  }
79
80  if (current_os == "ohos") {
81    defines += [ "OHOS_PLATFORM" ]
82  }
83
84  if (current_os == "mingw") {
85    defines += [ "WINDOWS_PLATFORM" ]
86  }
87
88  innerapi_tags = [ "platformsdk" ]
89
90  subsystem_name = "distributeddatamgr"
91  part_name = "pasteboard"
92}
93