1# Copyright (c) 2022 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("//build/ohos/sa_profile/sa_profile.gni") 16 17ohos_sa_profile("socperf_sa_profile") { 18 sources = [ "sa_profile/1906.xml" ] 19 part_name = "soc_perf" 20} 21 22ohos_prebuilt_etc("socperf_resource_config") { 23 source = "configs/socperf_resource_config.xml" 24 install_enable = true 25 module_install_dir = "etc/soc_perf" 26 part_name = "soc_perf" 27 subsystem_name = "resourceschedule" 28} 29ohos_prebuilt_etc("socperf_boost_config") { 30 source = "configs/socperf_boost_config.xml" 31 install_enable = true 32 module_install_dir = "etc/soc_perf" 33 part_name = "soc_perf" 34 subsystem_name = "resourceschedule" 35} 36group("socperf_config") { 37 deps = [ 38 ":socperf_boost_config", 39 ":socperf_resource_config", 40 ] 41} 42 43ohos_shared_library("socperf_server") { 44 sources = [ 45 "src/core/socperf.cpp", 46 "src/core/socperf_handler.cpp", 47 "src/server/socperf_server.cpp", 48 "src/server/socperf_stub.cpp", 49 ] 50 include_dirs = [ 51 "include", 52 "include/server", 53 "include/core", 54 "//base/customization/config_policy/interfaces/innerkits/include", 55 ] 56 deps = [ 57 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", 58 "//foundation/communication/ipc/interfaces/innerkits/ipc_core:ipc_core", 59 "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk:system_ability_fwk", 60 "//third_party/libxml2:xml2", 61 ] 62 external_deps = [ 63 "c_utils:utils", 64 "config_policy:configpolicy_util", 65 "eventhandler:libeventhandler", 66 "hitrace_native:hitrace_meter", 67 ] 68 part_name = "soc_perf" 69 subsystem_name = "resourceschedule" 70} 71 72config("socperf_client_public_config") { 73 include_dirs = [ 74 "include", 75 "include/client", 76 ] 77} 78 79ohos_shared_library("socperf_client") { 80 sources = [ 81 "src/client/socperf_client.cpp", 82 "src/client/socperf_proxy.cpp", 83 ] 84 include_dirs = [ 85 "include", 86 "include/client", 87 "//foundation/systemabilitymgr/safwk/services/safwk/include", 88 ] 89 public_configs = [ ":socperf_client_public_config" ] 90 deps = [ 91 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", 92 "//foundation/communication/ipc/interfaces/innerkits/ipc_core:ipc_core", 93 "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", 94 ] 95 part_name = "soc_perf" 96 subsystem_name = "resourceschedule" 97 external_deps = [ "c_utils:utils" ] 98} 99 100ohos_executable("socperf_test") { 101 sources = [ "test/unittest/socperf_test.cpp" ] 102 include_dirs = [ 103 "include", 104 "include/client", 105 ] 106 deps = [ 107 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", 108 "//foundation/communication/ipc/interfaces/innerkits/ipc_core:ipc_core", 109 "//foundation/resourceschedule/resource_schedule_service/soc_perf:socperf_client", 110 "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk:system_ability_fwk", 111 "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", 112 ] 113 install_enable = true 114 part_name = "soc_perf" 115 subsystem_name = "resourceschedule" 116 external_deps = [ "c_utils:utils" ] 117} 118