• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021 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/config.gni")
16
17## Build so {{{
18config("config") {
19  visibility = [ ":*" ]
20
21  cflags = [
22    "-Wall",
23    "-Werror",
24    "-g3",
25    "-Wunused-variable",
26    "-Wno-unused-but-set-variable",
27  ]
28  cflags_cc = [ "-fexceptions" ]
29}
30
31ohos_shared_headers("smartperf_daemon") {
32  include_dirs = [
33    "interface"
34  ]
35
36  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
37  part_name = "${OHOS_PROFILER_PART_NAME}"
38}
39
40ohos_executable("SP_daemon") {
41  sources = [
42    "AI_schedule.cpp",
43    "ByTrace.cpp",
44    "CPU.cpp",
45    "Capture.cpp",
46    "DDR.cpp",
47    "Dubai.cpp",
48    "FPS.cpp",
49    "FileDescriptor.cpp",
50    "GPU.cpp",
51    "GameEvent.cpp",
52    "GetLog.cpp",
53    "GpuCounter.cpp",
54    "GpuCounterCallback.cpp",
55    "Network.cpp",
56    "Power.cpp",
57    "RAM.cpp",
58    "Temperature.cpp",
59    "Threads.cpp",
60    "client_control.cpp",
61    "control_call_cmd.cpp",
62    "cpu_info.cpp",
63    "editor_command.cpp",
64    "effective.cpp",
65    "heartbeat.cpp",
66    "hiperf.cpp",
67    "lock_frequency.cpp",
68    "navigation.cpp",
69    "parse_click_complete_trace.cpp",
70    "parse_click_response_trace.cpp",
71    "parse_radar.cpp",
72    "parse_slide_fps_trace.cpp",
73    "sdk_data_recv.cpp",
74    "service_plugin.cpp",
75    "smartperf_command.cpp",
76    "smartperf_main.cpp",
77    "sp_log.cpp",
78    "sp_profiler_factory.cpp",
79    "sp_server_socket.cpp",
80    "sp_task.cpp",
81    "sp_thread_socket.cpp",
82    "sp_utils.cpp",
83    "stalling_rate_trace.cpp",
84    "startup_delay.cpp",
85  ]
86
87  sources += [
88    "argument_parser.cpp",
89    "task_manager.cpp",
90    "thread_pool.cpp",
91  ]
92
93  cflags = [
94    "-O2",
95    "-ffunction-sections",
96    "-fdata-sections",
97    "-fvisibility=hidden",
98    "-flto",
99  ]
100  ldflags = [ "-Wl,--gc-sections", "-flto" ]
101  include_dirs = [ "include" ]
102  configs = [ ":config" ]
103  deps = [
104    ":smartperf_daemon"
105  ]
106  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
107  part_name = "${OHOS_PROFILER_PART_NAME}"
108  external_deps = [
109    "ability_base:want",
110    "c_utils:utils",
111    "common_event_service:cesfwk_innerkits",
112    "graphic_2d:librender_service_base",
113    "graphic_2d:librender_service_client",
114    "hilog:libhilog",
115    "hisysevent:libhisysevent",
116    "hiview:libucollection_utility",
117    "image_framework:image_native",
118    "init:libbegetutil",
119    "ipc:ipc_core",
120    "libpng:libpng",
121    "samgr:samgr_proxy",
122    "window_manager:libdm",
123    "window_manager:libwm",
124  ]
125  defines = [
126    "HI_LOG_ENABLE",
127    "LOG_DOMAIN = 0xD004100",
128  ]
129  if (arkxtest_able) {
130    external_deps += [ "arkxtest:test_server_client" ]
131    defines += [ "ARKTEST_ENABLE" ]
132  }
133}
134## Build so }}}
135