1# Copyright (c) 2021-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("//foundation/arkui/ace_engine/ace_config.gni") 16import( 17 "//foundation/arkui/ace_engine/adapter/ohos/services/uiservice/uiservicems.gni") 18 19ohos_prebuilt_etc("ui_service.cfg") { 20 relative_install_dir = "init" 21 source = "ui_service.cfg" 22 part_name = ace_engine_part 23 subsystem_name = ace_engine_subsystem 24} 25 26group("uiservice_target") { 27 deps = [ ":uiservice" ] 28} 29 30config("uiservicems_config") { 31 include_dirs = [ 32 "include/", 33 "$ace_root/interfaces/inner_api/ui_service_manager/include", 34 ] 35 cflags = [] 36 if (target_cpu == "arm") { 37 cflags += [ "-DBINDER_IPC_32BIT" ] 38 } 39} 40 41template("uiservice_static") { 42 forward_variables_from(invoker, "*") 43 44 ohos_source_set(target_name) { 45 subsystem_name = ace_engine_subsystem 46 part_name = ace_engine_part 47 defines += invoker.defines 48 cflags_cc += invoker.cflags_cc 49 branch_protector_ret = "pac_ret" 50 sources = uiservice_files 51 configs = [ 52 ":uiservicems_config", 53 "$ace_root:ace_config", 54 ] 55 external_deps = [ 56 "ability_base:want", 57 "access_token:libtokenid_sdk", 58 "c_utils:utils", 59 "eventhandler:libeventhandler", 60 "hilog:libhilog", 61 "ipc:ipc_core", 62 "safwk:system_ability_fwk", 63 ] 64 65 if (uiservice_xcollie_enable) { 66 external_deps += [ "hicollie:libhicollie" ] 67 defines += [ "UISERVICE_MGR_XCOLLIE_ENABLE" ] 68 } 69 } 70} 71 72foreach(item, ace_platforms) { 73 platform = item.name 74 if (platform == "ohos") { 75 # generate uiservice_static lib 76 uiservice_static("uiservice_static_" + item.name) { 77 defines = [] 78 config = { 79 } 80 81 if (defined(item.config)) { 82 config = item.config 83 } 84 85 if (defined(config.defines)) { 86 defines = config.defines 87 } 88 89 if (defined(config.cflags_cc)) { 90 cflags_cc = config.cflags_cc 91 } 92 } 93 } 94} 95 96ohos_shared_library("uiservice") { 97 sanitize = { 98 cfi = true 99 cfi_cross_dso = true 100 debug = false 101 } 102 branch_protector_ret = "pac_ret" 103 deps = [ ":uiservice_static_ohos" ] 104 part_name = ace_engine_part 105 subsystem_name = ace_engine_subsystem 106 configs = [ "$ace_root:ace_coverage_config" ] 107 external_deps = [ "hilog:libhilog" ] 108} 109