1# Copyright (C) 2021-2023 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("../time.gni") 15 16config("time_service_config") { 17 visibility = [ ":*" ] 18 include_dirs = [ 19 "${api_path}/include", 20 "../utils/native/include", 21 "time/include", 22 "time/include/inner_api_include", 23 "timer/include", 24 "dfx/include", 25 "ipc/base", 26 "ipc/proxy", 27 "ipc/stub", 28 "ipc/stub/inner_api_include", 29 "${time_service_path}", 30 ] 31 cflags = [ "-fvisibility=hidden" ] 32 cflags_cc = [ "-fvisibility-inlines-hidden" ] 33} 34 35ohos_shared_library("time_system_ability") { 36 configs = [ "${time_utils_path}:utils_config" ] 37 configs += [ ":time_service_config" ] 38 configs += [ "//build/config/gcc:symbol_visibility_hidden" ] 39 sources = [ 40 "./time_system_ability.cpp", 41 "dfx/src/time_cmd_dispatcher.cpp", 42 "dfx/src/time_cmd_parse.cpp", 43 "dfx/src/time_sysevent.cpp", 44 "ipc/proxy/timer_call_back_proxy.cpp", 45 "ipc/stub/time_service_stub.cpp", 46 "ipc/stub/timer_notify_callback_stub.cpp", 47 "time/src/itimer_info.cpp", 48 "time/src/net_conn_callback_observer.cpp", 49 "time/src/nitz_subscriber.cpp", 50 "time/src/ntp_trusted_time.cpp", 51 "time/src/ntp_update_time.cpp", 52 "time/src/power_subscriber.cpp", 53 "time/src/simple_timer_info.cpp", 54 "time/src/sntp_client.cpp", 55 "time/src/time_service_notify.cpp", 56 "time/src/time_tick_notify.cpp", 57 "time/src/time_zone_info.cpp", 58 "time/src/timer_notify_callback.cpp", 59 "timer/src/batch.cpp", 60 "timer/src/timer_database.cpp", 61 "timer/src/timer_handler.cpp", 62 "timer/src/timer_info.cpp", 63 "timer/src/timer_manager.cpp", 64 "timer/src/timer_proxy.cpp", 65 ] 66 67 deps = [ "${time_utils_path}:time_utils" ] 68 external_deps = [ 69 "ability_base:want", 70 "ability_runtime:abilitykit_native", 71 "ability_runtime:wantagent_innerkits", 72 "access_token:libaccesstoken_sdk", 73 "access_token:libtokenid_sdk", 74 "common_event_service:cesfwk_innerkits", 75 "hilog:libhilog", 76 "hisysevent:libhisysevent", 77 "init:libbeget_proxy", 78 "init:libbegetutil", 79 "ipc:ipc_single", 80 "netmanager_base:net_conn_manager_if", 81 "os_account:os_account_innerkits", 82 "relational_store:native_dataability", 83 "relational_store:native_rdb", 84 "safwk:system_ability_fwk", 85 "samgr:samgr_proxy", 86 ] 87 defines = [] 88 if (device_standby) { 89 external_deps += [ "device_standby:standby_innerkits" ] 90 defines += [ "DEVICE_STANDBY_ENABLE" ] 91 } 92 93 if (defined(global_parts_info) && 94 defined(global_parts_info.powermgr_power_manager)) { 95 external_deps += [ "power_manager:powermgr_client" ] 96 defines += [ "POWER_MANAGER_ENABLE" ] 97 } 98 99 branch_protector_ret = "pac_ret" 100 sanitize = { 101 ubsan = true 102 boundary_sanitize = true 103 cfi = true 104 cfi_cross_dso = true 105 debug = time_sanitize_debug 106 } 107 part_name = "time_service" 108 subsystem_name = "time" 109} 110 111ohos_static_library("time_system_ability_static") { 112 configs = [ "${time_utils_path}:utils_config" ] 113 configs += [ ":time_service_config" ] 114 configs += [ "//build/config/gcc:symbol_visibility_hidden" ] 115 sources = [ 116 "./time_system_ability.cpp", 117 "dfx/src/time_cmd_dispatcher.cpp", 118 "dfx/src/time_cmd_parse.cpp", 119 "dfx/src/time_sysevent.cpp", 120 "ipc/proxy/timer_call_back_proxy.cpp", 121 "ipc/stub/time_service_stub.cpp", 122 "ipc/stub/timer_notify_callback_stub.cpp", 123 "time/src/itimer_info.cpp", 124 "time/src/net_conn_callback_observer.cpp", 125 "time/src/nitz_subscriber.cpp", 126 "time/src/ntp_trusted_time.cpp", 127 "time/src/ntp_update_time.cpp", 128 "time/src/power_subscriber.cpp", 129 "time/src/simple_timer_info.cpp", 130 "time/src/sntp_client.cpp", 131 "time/src/time_service_notify.cpp", 132 "time/src/time_tick_notify.cpp", 133 "time/src/time_zone_info.cpp", 134 "time/src/timer_notify_callback.cpp", 135 "timer/src/batch.cpp", 136 "timer/src/timer_database.cpp", 137 "timer/src/timer_handler.cpp", 138 "timer/src/timer_info.cpp", 139 "timer/src/timer_manager.cpp", 140 "timer/src/timer_proxy.cpp", 141 ] 142 143 deps = [ "${time_utils_path}:time_utils" ] 144 external_deps = [ 145 "ability_base:want", 146 "ability_runtime:abilitykit_native", 147 "ability_runtime:wantagent_innerkits", 148 "access_token:libaccesstoken_sdk", 149 "access_token:libtokenid_sdk", 150 "common_event_service:cesfwk_innerkits", 151 "hilog:libhilog", 152 "hisysevent:libhisysevent", 153 "init:libbeget_proxy", 154 "ipc:ipc_single", 155 "netmanager_base:net_conn_manager_if", 156 "os_account:os_account_innerkits", 157 "relational_store:native_dataability", 158 "relational_store:native_rdb", 159 "safwk:system_ability_fwk", 160 "samgr:samgr_proxy", 161 ] 162 defines = [] 163 if (device_standby) { 164 external_deps += [ "device_standby:standby_innerkits" ] 165 defines += [ "DEVICE_STANDBY_ENABLE" ] 166 } 167 168 if (defined(global_parts_info) && 169 defined(global_parts_info.powermgr_power_manager)) { 170 external_deps += [ "power_manager:powermgr_client" ] 171 defines += [ "POWER_MANAGER_ENABLE" ] 172 } 173 174 branch_protector_ret = "pac_ret" 175 sanitize = { 176 ubsan = true 177 boundary_sanitize = true 178 cfi = true 179 cfi_cross_dso = true 180 debug = time_sanitize_debug 181 } 182 part_name = "time_service" 183 subsystem_name = "time" 184} 185