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")
15
16config("concurrent_task_config") {
17  visibility = [ ":*" ]
18  cflags_cc = [ "-fexceptions" ]
19  cflags = [
20    "-fstack-protector-strong",
21    "-Wno-shift-negative-value",
22  ]
23  include_dirs = [
24    "include",
25    "../include",
26    "../frameworks/concurrent_task_client/include/",
27    "../interfaces/inner_api/",
28    "../common/include",
29  ]
30}
31
32ohos_shared_library("concurrentsvc") {
33  public_configs = [ ":concurrent_task_config" ]
34  branch_protector_ret = "pac_ret"
35  sanitize = {
36    cfi = true
37    cfi_cross_dso = true
38    cfi_no_nvcall = true
39    cfi_vcall_ical_only = true
40    debug = false
41  }
42
43  cflags_cc = [
44    "-fomit-frame-pointer",
45    "-fdata-sections",
46    "-ffunction-sections",
47    "-fno-unroll-loops",
48    "-fno-exceptions",
49    "-fno-unwind-tables",
50    "-fno-asynchronous-unwind-tables",
51    "-g0",
52    "-Os",
53  ]
54
55  ldflags = [ "-Wl,--exclude-libs=ALL" ]
56  sources = [
57    "../common/src/config_reader.cpp",
58    "src/concurrent_task_controller.cpp",
59    "src/concurrent_task_service.cpp",
60    "src/concurrent_task_service_ability.cpp",
61    "src/concurrent_task_service_stub.cpp",
62    "src/qos_interface.cpp",
63    "src/qos_policy.cpp",
64  ]
65
66  deps = [ "../etc/param:ffrt_etc" ]
67
68  if (defined(
69      global_parts_info.hmosresourceschedule_frame_aware_sched_override)) {
70    defines = [ "QOS_EXT_ENABLE" ]
71  }
72
73  external_deps = [
74    "access_token:libaccesstoken_sdk",
75    "c_utils:utils",
76    "config_policy:configpolicy_util",
77    "frame_aware_sched:rtg_interface",
78    "hilog:libhilog",
79    "hitrace:hitrace_meter",
80    "init:libbegetutil",
81    "ipc:ipc_single",
82    "jsoncpp:jsoncpp",
83    "libxml2:libxml2",
84    "safwk:system_ability_fwk",
85    "samgr:samgr_proxy",
86  ]
87
88  subsystem_name = "resourceschedule"
89  part_name = "qos_manager"
90}
91