1# Copyright (C) 2022 Huawei Technologies Co., Ltd. 2# Licensed under the Mulan PSL v2. 3# You can use this software according to the terms and conditions of the Mulan PSL v2. 4# You may obtain a copy of Mulan PSL v2 at: 5# http://license.coscl.org.cn/MulanPSL2 6# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR 7# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR 8# PURPOSE. 9# See the Mulan PSL v2 for more details. 10 11import("//base/tee/tee_client/tee_client.gni") 12import("//build/ohos.gni") 13import("//build/ohos_var.gni") 14 15component_type = "" 16if (defined(global_parts_info) && 17 defined(global_parts_info.bundlemanager_bundle_framework)) { 18 component_type = "system" 19} 20 21ohos_shared_library("libcadaemon") { 22 part_name = "tee_client" 23 subsystem_name = "tee" 24 defines = [] 25 26 if (component_type == "system") { 27 defines += [ 28 "ENABLE_FDSAN_CHECK", 29 "CONFIG_LOG_REPORT", 30 ] 31 32 sources = [ 33 "../../../../frameworks/libteec_vendor/load_sec_file.c", 34 "../../../../frameworks/libteec_vendor/tee_client_api.c", 35 "../../../../frameworks/libteec_vendor/tee_client_app_load.c", 36 "../../../../frameworks/tee_file/tee_file.c", 37 "../../../authentication/tcu_authentication.c", 38 "../../../authentication/tee_auth_common.c", 39 "../../../authentication/tee_auth_system.cpp", 40 "../../../authentication/tee_get_native_cert.c", 41 "../../src/ca_daemon/cadaemon_service.cpp", 42 "../../src/ca_daemon/cadaemon_stub.cpp", 43 "../../src/tui_daemon/tee_tui_daemon_wrapper.cpp", 44 "../../src/tui_daemon/tui_file.cpp", 45 ] 46 47 include_dirs = [ 48 "../../../../interfaces/inner_api", 49 "../../../../frameworks/include/", 50 "../../../../frameworks/include/standard/", 51 "../../../../frameworks/include/standard/teec_system", 52 "../../../../frameworks/libteec_vendor/", 53 "../../../authentication", 54 "../../src/ca_daemon", 55 "../../../../services/cadaemon/src/tui_daemon", 56 ] 57 58 if (tee_client_features_tui) { 59 deps = [ "../../../../services/cadaemon/build/standard:libcadaemon_tui" ] 60 } 61 62 external_deps = [ 63 "access_token:libaccesstoken_sdk", 64 "bounds_checking_function:libsec_shared", 65 "bundle_framework:bundlemgr_mini", 66 "c_utils:utils", 67 "hilog:libhilog", 68 "ipc:ipc_single", 69 "openssl:libcrypto_shared", 70 "safwk:system_ability_fwk", 71 "samgr:samgr_proxy", 72 "hisysevent:libhisysevent", 73 ] 74 75 sanitize = { 76 cfi = true 77 cfi_cross_dso = true 78 debug = false 79 } 80 } 81} 82 83if (component_type == "system") { 84 declare_args() { 85 hash_string = "" 86 } 87 if (tee_client_features_tui) { 88 ohos_shared_library("libcadaemon_tui") { 89 part_name = "tee_client" 90 subsystem_name = "tee" 91 output_extension = "so" 92 defines = [] 93 94 # hash_string is md5sum of tui ttf file 95 hash_string = 96 "8978e05044e7089ad6a9de38c505c8148305607983487435a916d2610700a7ca" 97 98 if (hash_string != "") { 99 defines += [ "FONT_HASH_VAL=\"$hash_string\"" ] 100 } else { 101 defines += [ "FONT_HASH_VAL=\"hash_string can not be set\"" ] 102 } 103 defines += [ "ENABLE_FDSAN_CHECK" ] 104 sources = [ 105 "../../../../frameworks/tee_file/tee_file.c", 106 "../../src/tui_daemon/tee_tui_daemon.cpp", 107 "../../src/tui_daemon/tui_event.cpp", 108 ] 109 110 include_dirs = [ 111 "../../../../interfaces/inner_api", 112 "../../../../frameworks/include/", 113 "../../../../frameworks/include/standard/", 114 "../../../../frameworks/include/standard/teec_system", 115 "../../../../frameworks/libteec_vendor/", 116 "../../../authentication", 117 "../../src/ca_daemon", 118 "../../src/tui_daemon", 119 ] 120 121 external_deps = [ 122 "ability_base:want", 123 "bounds_checking_function:libsec_shared", 124 "c_utils:utils", 125 "call_manager:tel_call_manager_api", 126 "hilog:libhilog", 127 "image_framework:image_native", 128 "ipc:ipc_single", 129 "power_manager:powermgr_client", 130 "safwk:system_ability_fwk", 131 "samgr:samgr_proxy", 132 "init:libbegetutil" 133 ] 134 135 if (component_type == "system") { 136 # blue area use window_manager:libdm, yellow area use window_manager:libdm_lite 137 # libdm_lite that does not introduce graph dependency is used to reduce the memory 138 external_deps += [ "window_manager:libdm_lite" ] 139 defines += [ "SCENE_BOARD_ENABLE" ] 140 } 141 142 ldflags = [ 143 "-Wl,-z,max-page-size=4096", 144 "-Wl,-z,separate-code", 145 ] 146 sanitize = { 147 cfi = true 148 cfi_cross_dso = true 149 debug = false 150 } 151 } 152 } 153} 154