1# Copyright (c) 2022-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.
13import("//build/ohos.gni")
14import("//build/ohos_var.gni")
15import("//foundation/distributeddatamgr/pasteboard/pasteboard.gni")
16
17group("build_module") {
18  deps = [ ":pasteboard_framework" ]
19}
20config("module_public_config") {
21  visibility = [ ":*" ]
22  include_dirs = [
23    "${pasteboard_utils_path}/native/include",
24    "${pasteboard_service_path}/dfx/src",
25    "include",
26    "include/device",
27    "include/ffrt",
28  ]
29}
30
31ohos_shared_library("pasteboard_framework") {
32  branch_protector_ret = "pac_ret"
33  sanitize = {
34    ubsan = true
35    boundary_sanitize = true
36    cfi = true
37    cfi_cross_dso = true
38    debug = false
39  }
40  sources = [
41    "clip/clip_plugin.cpp",
42    "clip/default_clip.cpp",
43    "device/dev_profile.cpp",
44    "device/distributed_module_config.cpp",
45    "device/dm_adapter.cpp",
46    "device/pasteboard_static_capability.cpp",
47    "eventcenter/event.cpp",
48    "eventcenter/event_center.cpp",
49    "eventcenter/pasteboard_event.cpp",
50    "ffrt/ffrt_utils.cpp",
51    "serializable/serializable.cpp",
52  ]
53  cflags = [ "-Wno-multichar" ]
54
55  cflags_cc = [
56    "-fvisibility=hidden",
57    "-fstack-protector",
58    "-D_FORTIFY_SOURCE=2",
59    "-O2",
60  ]
61
62  defines = []
63
64  public_configs = [ ":module_public_config" ]
65
66  external_deps = [
67    "cJSON:cjson",
68    "c_utils:utils",
69    "ffrt:libffrt",
70    "hilog:libhilog",
71    "hisysevent:libhisysevent",
72    "init:libbeget_proxy",
73    "init:libbegetutil",
74    "ipc:ipc_core",
75  ]
76
77  if (pasteboard_device_info_manager_part_enabled) {
78    external_deps += [
79      "device_info_manager:distributed_device_profile_common",
80      "device_info_manager:distributed_device_profile_sdk",
81    ]
82    defines += [ "PB_DEVICE_INFO_MANAGER_ENABLE" ]
83  }
84
85  if (pasteboard_device_manager_part_enabled) {
86    external_deps += [ "device_manager:devicemanagersdk" ]
87    defines += [ "PB_DEVICE_MANAGER_ENABLE" ]
88  }
89  subsystem_name = "distributeddatamgr"
90  part_name = "pasteboard"
91}
92