1# Copyright (c) 2023-2024 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")
15
16sec_comp_root_dir = ".."
17
18config("security_component_framework_src_set_config") {
19  include_dirs = [
20    "common/include",
21    "${sec_comp_root_dir}/frameworks/inner_api/security_component/include",
22    "${sec_comp_root_dir}/interfaces/inner_api/security_component_common",
23    "${sec_comp_root_dir}/interfaces/inner_api/security_component/include",
24  ]
25}
26
27ohos_source_set("security_component_framework_src_set") {
28  subsystem_name = "security"
29  part_name = "security_component_manager"
30  sanitize = {
31    cfi = true
32    cfi_cross_dso = true
33    debug = false
34  }
35  branch_protector_ret = "pac_ret"
36  include_dirs = [
37    "common/include",
38    "security_component/include",
39  ]
40
41  sources = [
42    "common/src/sec_comp_tool.cpp",
43    "security_component/src/location_button.cpp",
44    "security_component/src/paste_button.cpp",
45    "security_component/src/save_button.cpp",
46    "security_component/src/sec_comp_base.cpp",
47    "security_component/src/sec_comp_click_event_parcel.cpp",
48  ]
49
50  configs = [ "${sec_comp_root_dir}/config:coverage_flags" ]
51  public_configs = [ ":security_component_framework_src_set_config" ]
52
53  external_deps = [
54    "access_token:libtokenid_sdk",
55    "c_utils:utils",
56    "hilog:libhilog",
57    "ipc:ipc_core",
58    "json:nlohmann_json_static",
59  ]
60
61  cflags_cc = [
62    "-DHILOG_ENABLE",
63    "-fvisibility=hidden",
64  ]
65}
66
67config("security_component_enhance_adapter_src_set_config") {
68  include_dirs = [
69    "common/include",
70    "enhance_adapter/include",
71    "${sec_comp_root_dir}/frameworks/inner_api/security_component/include",
72    "${sec_comp_root_dir}/interfaces/inner_api/security_component_common",
73    "${sec_comp_root_dir}/interfaces/inner_api/security_component/include",
74  ]
75}
76
77ohos_source_set("security_component_enhance_adapter_src_set") {
78  subsystem_name = "security"
79  part_name = "security_component_manager"
80  sanitize = {
81    cfi = true
82    cfi_cross_dso = true
83    debug = false
84  }
85  branch_protector_ret = "pac_ret"
86  include_dirs = [ "common/include" ]
87
88  sources = [ "enhance_adapter/src/sec_comp_enhance_adapter.cpp" ]
89
90  configs = [ "${sec_comp_root_dir}/config:coverage_flags" ]
91  public_configs = [ ":security_component_enhance_adapter_src_set_config" ]
92
93  external_deps = [
94    "c_utils:utils",
95    "hilog:libhilog",
96    "ipc:ipc_single",
97  ]
98
99  public_external_deps = [ "json:nlohmann_json_static" ]
100
101  cflags_cc = [
102    "-DHILOG_ENABLE",
103    "-fvisibility=hidden",
104  ]
105}
106
107ohos_source_set("security_component_enhance_adapter_service_src_set") {
108  subsystem_name = "security"
109  part_name = "security_component_manager"
110  sanitize = {
111    cfi = true
112    cfi_cross_dso = true
113    debug = false
114  }
115  branch_protector_ret = "pac_ret"
116  include_dirs = [ "common/include" ]
117
118  sources = [ "enhance_adapter/src/sec_comp_enhance_adapter.cpp" ]
119
120  configs = [ "${sec_comp_root_dir}/config:coverage_flags" ]
121  public_configs = [ ":security_component_enhance_adapter_src_set_config" ]
122
123  external_deps = [
124    "c_utils:utils",
125    "hilog:libhilog",
126    "ipc:ipc_single",
127  ]
128
129  public_external_deps = [ "json:nlohmann_json_static" ]
130
131  cflags_cc = [
132    "-DHILOG_ENABLE",
133    "-fvisibility=hidden",
134    "-DSEC_COMP_SERVICE_COMPILE_ENABLE",
135  ]
136}
137
138ohos_source_set("security_component_no_cfi_framework_src_set") {
139  branch_protector_ret = "pac_ret"
140  subsystem_name = "security"
141  part_name = "security_component_manager"
142  include_dirs = [
143    "common/include",
144    "security_component/include",
145    "${sec_comp_root_dir}/frameworks/inner_api/security_component/include",
146    "${sec_comp_root_dir}/interfaces/inner_api/security_component/include",
147  ]
148
149  sources = [
150    "common/src/sec_comp_tool.cpp",
151    "security_component/src/location_button.cpp",
152    "security_component/src/paste_button.cpp",
153    "security_component/src/save_button.cpp",
154    "security_component/src/sec_comp_base.cpp",
155    "security_component/src/sec_comp_click_event_parcel.cpp",
156  ]
157
158  configs = [ "${sec_comp_root_dir}/config:coverage_flags" ]
159  public_configs = [ ":security_component_framework_src_set_config" ]
160
161  external_deps = [
162    "access_token:libtokenid_sdk",
163    "c_utils:utils",
164    "hilog:libhilog",
165    "ipc:ipc_core",
166    "json:nlohmann_json_static",
167  ]
168
169  cflags_cc = [
170    "-DHILOG_ENABLE",
171    "-fvisibility=hidden",
172  ]
173}
174
175ohos_source_set("security_component_no_cfi_enhance_adapter_src_set") {
176  branch_protector_ret = "pac_ret"
177  subsystem_name = "security"
178  part_name = "security_component_manager"
179  include_dirs = [
180    "common/include",
181    "enhance_adapter/include",
182    "${sec_comp_root_dir}/interfaces/inner_api/security_component_common",
183    "${sec_comp_root_dir}/interfaces/inner_api/security_component/include",
184    "${sec_comp_root_dir}/frameworks/inner_api/security_component/include",
185  ]
186
187  sources = [ "enhance_adapter/src/sec_comp_enhance_adapter.cpp" ]
188
189  configs = [ "${sec_comp_root_dir}/config:coverage_flags" ]
190  public_configs = [ ":security_component_enhance_adapter_src_set_config" ]
191
192  external_deps = [
193    "c_utils:utils",
194    "hilog:libhilog",
195    "ipc:ipc_single",
196  ]
197
198  public_external_deps = [ "json:nlohmann_json_static" ]
199
200  cflags_cc = [
201    "-DHILOG_ENABLE",
202    "-fvisibility=hidden",
203  ]
204}
205