1# Copyright (C) 2022-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("//build/ohos.gni") 15import("../wallpaper.gni") 16 17config("wallpaper_service_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ 20 "include", 21 "${wallpaper_path}/utils/dfx/hisysevent_adapter", 22 "${wallpaper_path}/utils/dfx/hidumper_adapter", 23 ] 24} 25 26ohos_shared_library("wallpaper_service") { 27 sources = [ 28 "src/component_name.cpp", 29 "src/wallpaper_common_event_manager.cpp", 30 "src/wallpaper_common_event_subscriber.cpp", 31 "src/wallpaper_data.cpp", 32 "src/wallpaper_event_listener_proxy.cpp", 33 "src/wallpaper_service.cpp", 34 "src/wallpaper_service_cb_proxy.cpp", 35 ] 36 37 public_configs = [ ":wallpaper_service_config" ] 38 include_dirs = [ 39 "${wallpaper_path}/frameworks/native/include", 40 "${wallpaper_path}/utils/include", 41 ] 42 deps = [ 43 "${utils_path}:wallpaper_utils", 44 "${wallpaper_path}/frameworks/native:wallpaper_service_proxy", 45 ] 46 external_deps = [ 47 "ability_base:want", 48 "ability_base:zuri", 49 "ability_runtime:ability_connect_callback_stub", 50 "access_token:libaccesstoken_sdk", 51 "access_token:libtokenid_sdk", 52 "bundle_framework:appexecfwk_core", 53 "c_utils:utils", 54 "common_event_service:cesfwk_innerkits", 55 "config_policy:configpolicy_util", 56 "eventhandler:libeventhandler", 57 "graphic_2d:color_manager", 58 "graphic_2d:color_picker", 59 "hilog:libhilog", 60 "hitrace:hitrace_meter", 61 "image_framework:image_native", 62 "init:libbegetutil", 63 "ipc:ipc_single", 64 "cJSON:cjson", 65 "memmgr:memmgrclient", 66 "os_account:os_account_innerkits", 67 "safwk:system_ability_fwk", 68 "samgr:samgr_proxy", 69 "window_manager:libwsutils", 70 ] 71 cflags_cc = [ 72 "-fexceptions", 73 "-fvisibility=hidden", 74 "-fvisibility-inlines-hidden", 75 "-fdata-sections", 76 "-ffunction-sections", 77 "-Os", 78 ] 79 80 sanitize = { 81 cfi = true 82 cfi_cross_dso = true 83 cfi_vcall_icall_only = true 84 debug = false 85 integer_overflow = true 86 boundary_sanitize = true 87 ubsan = true 88 } 89 branch_protector_ret = "pac_ret" 90 91 defines = [] 92 if (theme_service) { 93 defines += [ "THEME_SERVICE" ] 94 } else { 95 external_deps += [ 96 "ability_runtime:ability_manager", 97 "ability_runtime:abilitykit_native", 98 ] 99 sources += [ 100 "src/wallpaper_extension_ability_connection.cpp", 101 "src/wallpaper_extension_ability_death_recipient.cpp", 102 ] 103 } 104 105 subsystem_name = "theme" 106 part_name = "wallpaper_mgr" 107} 108 109ohos_static_library("wallpaper_service_static") { 110 sources = [ 111 "src/component_name.cpp", 112 "src/wallpaper_common_event_manager.cpp", 113 "src/wallpaper_common_event_subscriber.cpp", 114 "src/wallpaper_data.cpp", 115 "src/wallpaper_event_listener_proxy.cpp", 116 "src/wallpaper_service.cpp", 117 "src/wallpaper_service_cb_proxy.cpp", 118 ] 119 120 public_configs = [ ":wallpaper_service_config" ] 121 include_dirs = [ 122 "${wallpaper_path}/frameworks/native/include", 123 "${wallpaper_path}/utils/include", 124 ] 125 deps = [ 126 "${utils_path}:wallpaper_utils", 127 "${wallpaper_path}/frameworks/native:wallpaper_service_proxy", 128 ] 129 external_deps = [ 130 "ability_base:want", 131 "ability_base:zuri", 132 "ability_runtime:ability_connect_callback_stub", 133 "access_token:libaccesstoken_sdk", 134 "access_token:libtokenid_sdk", 135 "bundle_framework:appexecfwk_core", 136 "c_utils:utils", 137 "common_event_service:cesfwk_innerkits", 138 "config_policy:configpolicy_util", 139 "eventhandler:libeventhandler", 140 "graphic_2d:color_manager", 141 "graphic_2d:color_picker", 142 "hilog:libhilog", 143 "hitrace:hitrace_meter", 144 "image_framework:image_native", 145 "init:libbegetutil", 146 "ipc:ipc_single", 147 "cJSON:cjson", 148 "memmgr:memmgrclient", 149 "os_account:os_account_innerkits", 150 "safwk:system_ability_fwk", 151 "samgr:samgr_proxy", 152 "window_manager:libwsutils", 153 ] 154 cflags_cc = [ 155 "-fdata-sections", 156 "-ffunction-sections", 157 "-Os", 158 ] 159 160 sanitize = { 161 cfi = true 162 cfi_cross_dso = true 163 cfi_vcall_icall_only = true 164 debug = false 165 integer_overflow = true 166 boundary_sanitize = true 167 ubsan = true 168 } 169 branch_protector_ret = "pac_ret" 170 171 defines = [] 172 if (theme_service) { 173 defines += [ "THEME_SERVICE" ] 174 } else { 175 external_deps += [ 176 "ability_runtime:ability_manager", 177 "ability_runtime:abilitykit_native", 178 ] 179 sources += [ 180 "src/wallpaper_extension_ability_connection.cpp", 181 "src/wallpaper_extension_ability_death_recipient.cpp", 182 ] 183 } 184 185 subsystem_name = "theme" 186 part_name = "wallpaper_mgr" 187} 188