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
15ohos_shared_library("libcadaemon") {
16  part_name = "tee_client"
17  subsystem_name = "tee"
18  defines = []
19
20  sources = [
21    "../../../../frameworks/libteec_vendor/load_sec_file.c",
22    "../../../../frameworks/libteec_vendor/tee_client_api.c",
23    "../../../../frameworks/libteec_vendor/tee_client_app_load.c",
24    "../../../authentication/tcu_authentication.c",
25    "../../../authentication/tee_auth_common.c",
26    "../../../authentication/tee_auth_system.cpp",
27    "../../../authentication/tee_get_native_cert.c",
28    "../../src/ca_daemon/cadaemon_service.cpp",
29    "../../src/ca_daemon/cadaemon_stub.cpp",
30  ]
31
32  include_dirs = [
33    "../../../../interfaces/kits/c/include",
34    "../../../../frameworks/include/",
35    "../../../../frameworks/include/standard/",
36    "../../../../frameworks/include/standard/teec_system",
37    "../../../../frameworks/libteec_vendor/",
38    "../../../authentication",
39    "../../src/ca_daemon",
40  ]
41
42  if (tee_client_features_tui) {
43    deps = [ "../standard:libcadaemon_tui" ]
44  }
45
46  external_deps = [
47    "access_token:libaccesstoken_sdk",
48    "bounds_checking_function:libsec_shared",
49    "c_utils:utils",
50    "hilog:libhilog",
51    "ipc:ipc_core",
52    "openssl:libcrypto_shared",
53    "safwk:system_ability_fwk",
54    "samgr:samgr_proxy",
55  ]
56}
57
58declare_args() {
59  hash_string = ""
60}
61ohos_shared_library("libcadaemon_tui") {
62  part_name = "tee_client"
63  subsystem_name = "tee"
64  output_extension = "so"
65  defines = []
66
67  # hash_string = exec_script(ttf_calc_hash_script, [], "string")
68  hash_string =
69      "2deabf97eaf17958dc24746b922779d9913008526daf1c853903547505a8f9ca"
70
71  # md5sum ttf_calc_hash_script
72  # print("get hash_string :" + hash_string + " and file path :" + ttf_calc_hash_script)
73  if (hash_string != "") {
74    defines += [ "FONT_HASH_VAL=\"$hash_string\"" ]
75  } else {
76    defines += [ "FONT_HASH_VAL=\"hash_string can not be set\"" ]
77  }
78
79  sources = [
80    "../../src/tui_daemon/tee_tui_daemon.cpp",
81    "../../src/tui_daemon/tui_event.cpp",
82  ]
83
84  include_dirs = [
85    "../../../../interfaces/kits/c/include",
86    "../../../../frameworks/include/",
87    "../../../../frameworks/include/standard/",
88    "../../../../frameworks/include/standard/teec_system",
89    "../../../../frameworks/libteec_vendor/",
90    "../../../authentication",
91    "../../src/ca_daemon",
92    "../../src/tui_daemon",
93  ]
94
95  external_deps = [
96    "ability_base:want",
97    "bounds_checking_function:libsec_shared",
98    "c_utils:utils",
99    "call_manager:tel_call_manager_api",
100    "hilog:libhilog",
101    "image_framework:image_native",
102    "ipc:ipc_core",
103    "power_manager:powermgr_client",
104    "safwk:system_ability_fwk",
105    "samgr:samgr_proxy",
106    "window_manager:libdm",
107  ]
108
109  ldflags = [
110    "-Wl,-z,max-page-size=4096",
111    "-Wl,-z,separate-code",
112  ]
113}
114