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.
13
14import("//build/ohos.gni")
15import("../soc_perf.gni")
16
17config("socperf_server_config") {
18  include_dirs = [
19    "core/include",
20    "server/include",
21    "${socperf_common}/include",
22    "${socperf_interfaces}/inner_api/socperf_client/include",
23  ]
24}
25
26ohos_shared_library("socperf_server") {
27  configs = [ ":socperf_server_config" ]
28
29  sources = [
30    "core/src/socperf.cpp",
31    "core/src/socperf_config.cpp",
32    "core/src/socperf_thread_wrap.cpp",
33    "server/src/socperf_server.cpp",
34    "server/src/socperf_stub.cpp",
35  ]
36
37  external_deps = [
38    "access_token:libaccesstoken_sdk",
39    "access_token:libtokenid_sdk",
40    "c_utils:utils",
41    "config_policy:configpolicy_util",
42    "eventhandler:libeventhandler",
43    "ffrt:libffrt",
44    "hilog:libhilog",
45    "hisysevent:libhisysevent",
46    "hitrace:hitrace_meter",
47    "init:libbegetutil",
48    "ipc:ipc_single",
49    "json:nlohmann_json_static",
50    "libxml2:libxml2",
51    "resource_schedule_service:resschedexe_client",
52    "safwk:system_ability_fwk",
53    "samgr:samgr_proxy",
54  ]
55
56  defines = [ "SOCPERF_ADAPTOR_FFRT" ]
57
58  if (defined(global_parts_info) &&
59      defined(global_parts_info.resourceschedule_resource_schedule_service)) {
60    external_deps += [ "resource_schedule_service:ressched_client" ]
61    defines += [ "RES_SCHED_SA_INIT" ]
62  }
63
64  shlib_type = "sa"
65  part_name = "soc_perf"
66  subsystem_name = "resourceschedule"
67  branch_protector_ret = "pac_ret"
68
69  sanitize = {
70    cfi = true
71    cfi_cross_dso = true
72    debug = false
73  }
74}
75
76ohos_static_library("socperf_server_static") {
77  configs = [ ":socperf_server_config" ]
78
79  sources = [
80    "core/src/socperf.cpp",
81    "core/src/socperf_config.cpp",
82    "core/src/socperf_thread_wrap.cpp",
83    "server/src/socperf_server.cpp",
84    "server/src/socperf_stub.cpp",
85  ]
86
87  external_deps = [
88    "access_token:libaccesstoken_sdk",
89    "access_token:libtokenid_sdk",
90    "c_utils:utils",
91    "config_policy:configpolicy_util",
92    "eventhandler:libeventhandler",
93    "ffrt:libffrt",
94    "hilog:libhilog",
95    "hisysevent:libhisysevent",
96    "hitrace:hitrace_meter",
97    "init:libbegetutil",
98    "ipc:ipc_single",
99    "json:nlohmann_json_static",
100    "libxml2:libxml2",
101    "resource_schedule_service:resschedexe_client",
102    "safwk:system_ability_fwk",
103    "samgr:samgr_proxy",
104  ]
105
106  defines = []
107
108  part_name = "soc_perf"
109  subsystem_name = "resourceschedule"
110  branch_protector_ret = "pac_ret"
111
112  sanitize = {
113    cfi = true
114    cfi_cross_dso = true
115    debug = false
116  }
117}
118