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 if (ace_engine_enable_uiservice_idl) { 56 sources += [ "//foundation/arkui/ace_engine/adapter/ohos/services/uiservice/src/ui_mgr_service_idl.cpp" ] 57 public_deps = [ "$ace_root/interfaces/inner_api/ui_service_manager:uiservice_manager_interface_set" ] 58 } 59 external_deps = [ 60 "ability_base:want", 61 "access_token:libtokenid_sdk", 62 "c_utils:utils", 63 "eventhandler:libeventhandler", 64 "hilog:libhilog", 65 "ipc:ipc_core", 66 "safwk:system_ability_fwk", 67 ] 68 69 if (uiservice_xcollie_enable) { 70 external_deps += [ "hicollie:libhicollie" ] 71 defines += [ "UISERVICE_MGR_XCOLLIE_ENABLE" ] 72 } 73 } 74} 75 76foreach(item, ace_platforms) { 77 platform = item.name 78 if (platform == "ohos") { 79 # generate uiservice_static lib 80 uiservice_static("uiservice_static_" + item.name) { 81 defines = [] 82 config = { 83 } 84 85 if (defined(item.config)) { 86 config = item.config 87 } 88 89 if (defined(config.defines)) { 90 defines = config.defines 91 } 92 93 if (defined(config.cflags_cc)) { 94 cflags_cc = config.cflags_cc 95 } 96 } 97 } 98} 99 100ohos_shared_library("uiservice") { 101 sanitize = { 102 cfi = true 103 cfi_cross_dso = true 104 debug = false 105 } 106 branch_protector_ret = "pac_ret" 107 deps = [ ":uiservice_static_ohos" ] 108 part_name = ace_engine_part 109 subsystem_name = ace_engine_subsystem 110 configs = [ "$ace_root:ace_coverage_config" ] 111 external_deps = [ "hilog:libhilog" ] 112} 113