13fc297bdSopenharmony_ci# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
23fc297bdSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
33fc297bdSopenharmony_ci# you may not use this file except in compliance with the License.
43fc297bdSopenharmony_ci# You may obtain a copy of the License at
53fc297bdSopenharmony_ci#
63fc297bdSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
73fc297bdSopenharmony_ci#
83fc297bdSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
93fc297bdSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
103fc297bdSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
113fc297bdSopenharmony_ci# See the License for the specific language governing permissions and
123fc297bdSopenharmony_ci# limitations under the License.
133fc297bdSopenharmony_ci
143fc297bdSopenharmony_ciimport("//build/ohos.gni")
153fc297bdSopenharmony_ciimport("../soc_perf.gni")
163fc297bdSopenharmony_ci
173fc297bdSopenharmony_ciconfig("socperf_server_config") {
183fc297bdSopenharmony_ci  include_dirs = [
193fc297bdSopenharmony_ci    "core/include",
203fc297bdSopenharmony_ci    "server/include",
213fc297bdSopenharmony_ci    "${socperf_common}/include",
223fc297bdSopenharmony_ci    "${socperf_interfaces}/inner_api/socperf_client/include",
233fc297bdSopenharmony_ci  ]
243fc297bdSopenharmony_ci}
253fc297bdSopenharmony_ci
263fc297bdSopenharmony_ciohos_shared_library("socperf_server") {
273fc297bdSopenharmony_ci  configs = [ ":socperf_server_config" ]
283fc297bdSopenharmony_ci
293fc297bdSopenharmony_ci  sources = [
303fc297bdSopenharmony_ci    "core/src/socperf.cpp",
313fc297bdSopenharmony_ci    "core/src/socperf_config.cpp",
323fc297bdSopenharmony_ci    "core/src/socperf_thread_wrap.cpp",
333fc297bdSopenharmony_ci    "server/src/socperf_server.cpp",
343fc297bdSopenharmony_ci    "server/src/socperf_stub.cpp",
353fc297bdSopenharmony_ci  ]
363fc297bdSopenharmony_ci
373fc297bdSopenharmony_ci  external_deps = [
383fc297bdSopenharmony_ci    "access_token:libaccesstoken_sdk",
393fc297bdSopenharmony_ci    "access_token:libtokenid_sdk",
403fc297bdSopenharmony_ci    "c_utils:utils",
413fc297bdSopenharmony_ci    "config_policy:configpolicy_util",
423fc297bdSopenharmony_ci    "eventhandler:libeventhandler",
433fc297bdSopenharmony_ci    "ffrt:libffrt",
443fc297bdSopenharmony_ci    "hilog:libhilog",
453fc297bdSopenharmony_ci    "hisysevent:libhisysevent",
463fc297bdSopenharmony_ci    "hitrace:hitrace_meter",
473fc297bdSopenharmony_ci    "init:libbegetutil",
483fc297bdSopenharmony_ci    "ipc:ipc_single",
493fc297bdSopenharmony_ci    "json:nlohmann_json_static",
503fc297bdSopenharmony_ci    "libxml2:libxml2",
513fc297bdSopenharmony_ci    "resource_schedule_service:resschedexe_client",
523fc297bdSopenharmony_ci    "safwk:system_ability_fwk",
533fc297bdSopenharmony_ci    "samgr:samgr_proxy",
543fc297bdSopenharmony_ci  ]
553fc297bdSopenharmony_ci
563fc297bdSopenharmony_ci  defines = [ "SOCPERF_ADAPTOR_FFRT" ]
573fc297bdSopenharmony_ci
583fc297bdSopenharmony_ci  if (defined(global_parts_info) &&
593fc297bdSopenharmony_ci      defined(global_parts_info.resourceschedule_resource_schedule_service)) {
603fc297bdSopenharmony_ci    external_deps += [ "resource_schedule_service:ressched_client" ]
613fc297bdSopenharmony_ci    defines += [ "RES_SCHED_SA_INIT" ]
623fc297bdSopenharmony_ci  }
633fc297bdSopenharmony_ci
643fc297bdSopenharmony_ci  shlib_type = "sa"
653fc297bdSopenharmony_ci  part_name = "soc_perf"
663fc297bdSopenharmony_ci  subsystem_name = "resourceschedule"
673fc297bdSopenharmony_ci  branch_protector_ret = "pac_ret"
683fc297bdSopenharmony_ci
693fc297bdSopenharmony_ci  sanitize = {
703fc297bdSopenharmony_ci    cfi = true
713fc297bdSopenharmony_ci    cfi_cross_dso = true
723fc297bdSopenharmony_ci    debug = false
733fc297bdSopenharmony_ci  }
743fc297bdSopenharmony_ci}
753fc297bdSopenharmony_ci
763fc297bdSopenharmony_ciohos_static_library("socperf_server_static") {
773fc297bdSopenharmony_ci  configs = [ ":socperf_server_config" ]
783fc297bdSopenharmony_ci
793fc297bdSopenharmony_ci  sources = [
803fc297bdSopenharmony_ci    "core/src/socperf.cpp",
813fc297bdSopenharmony_ci    "core/src/socperf_config.cpp",
823fc297bdSopenharmony_ci    "core/src/socperf_thread_wrap.cpp",
833fc297bdSopenharmony_ci    "server/src/socperf_server.cpp",
843fc297bdSopenharmony_ci    "server/src/socperf_stub.cpp",
853fc297bdSopenharmony_ci  ]
863fc297bdSopenharmony_ci
873fc297bdSopenharmony_ci  external_deps = [
883fc297bdSopenharmony_ci    "access_token:libaccesstoken_sdk",
893fc297bdSopenharmony_ci    "access_token:libtokenid_sdk",
903fc297bdSopenharmony_ci    "c_utils:utils",
913fc297bdSopenharmony_ci    "config_policy:configpolicy_util",
923fc297bdSopenharmony_ci    "eventhandler:libeventhandler",
933fc297bdSopenharmony_ci    "ffrt:libffrt",
943fc297bdSopenharmony_ci    "hilog:libhilog",
953fc297bdSopenharmony_ci    "hisysevent:libhisysevent",
963fc297bdSopenharmony_ci    "hitrace:hitrace_meter",
973fc297bdSopenharmony_ci    "init:libbegetutil",
983fc297bdSopenharmony_ci    "ipc:ipc_single",
993fc297bdSopenharmony_ci    "json:nlohmann_json_static",
1003fc297bdSopenharmony_ci    "libxml2:libxml2",
1013fc297bdSopenharmony_ci    "resource_schedule_service:resschedexe_client",
1023fc297bdSopenharmony_ci    "safwk:system_ability_fwk",
1033fc297bdSopenharmony_ci    "samgr:samgr_proxy",
1043fc297bdSopenharmony_ci  ]
1053fc297bdSopenharmony_ci
1063fc297bdSopenharmony_ci  defines = []
1073fc297bdSopenharmony_ci
1083fc297bdSopenharmony_ci  part_name = "soc_perf"
1093fc297bdSopenharmony_ci  subsystem_name = "resourceschedule"
1103fc297bdSopenharmony_ci  branch_protector_ret = "pac_ret"
1113fc297bdSopenharmony_ci
1123fc297bdSopenharmony_ci  sanitize = {
1133fc297bdSopenharmony_ci    cfi = true
1143fc297bdSopenharmony_ci    cfi_cross_dso = true
1153fc297bdSopenharmony_ci    debug = false
1163fc297bdSopenharmony_ci  }
1173fc297bdSopenharmony_ci}
118