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 "json:nlohmann_json_static", 98 ] 99 100 cflags_cc = [ 101 "-DHILOG_ENABLE", 102 "-fvisibility=hidden", 103 ] 104} 105 106ohos_source_set("security_component_enhance_adapter_service_src_set") { 107 subsystem_name = "security" 108 part_name = "security_component_manager" 109 sanitize = { 110 cfi = true 111 cfi_cross_dso = true 112 debug = false 113 } 114 branch_protector_ret = "pac_ret" 115 include_dirs = [ "common/include" ] 116 117 sources = [ "enhance_adapter/src/sec_comp_enhance_adapter.cpp" ] 118 119 configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] 120 public_configs = [ ":security_component_enhance_adapter_src_set_config" ] 121 122 external_deps = [ 123 "c_utils:utils", 124 "hilog:libhilog", 125 "ipc:ipc_single", 126 "json:nlohmann_json_static", 127 ] 128 129 cflags_cc = [ 130 "-DHILOG_ENABLE", 131 "-fvisibility=hidden", 132 "-DSEC_COMP_SERVICE_COMPILE_ENABLE", 133 ] 134} 135 136ohos_source_set("security_component_no_cfi_framework_src_set") { 137 branch_protector_ret = "pac_ret" 138 subsystem_name = "security" 139 part_name = "security_component_manager" 140 include_dirs = [ 141 "common/include", 142 "security_component/include", 143 "${sec_comp_root_dir}/frameworks/inner_api/security_component/include", 144 "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", 145 ] 146 147 sources = [ 148 "common/src/sec_comp_tool.cpp", 149 "security_component/src/location_button.cpp", 150 "security_component/src/paste_button.cpp", 151 "security_component/src/save_button.cpp", 152 "security_component/src/sec_comp_base.cpp", 153 "security_component/src/sec_comp_click_event_parcel.cpp", 154 ] 155 156 configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] 157 public_configs = [ ":security_component_framework_src_set_config" ] 158 159 external_deps = [ 160 "access_token:libtokenid_sdk", 161 "c_utils:utils", 162 "hilog:libhilog", 163 "ipc:ipc_core", 164 "json:nlohmann_json_static", 165 ] 166 167 cflags_cc = [ 168 "-DHILOG_ENABLE", 169 "-fvisibility=hidden", 170 ] 171} 172 173ohos_source_set("security_component_no_cfi_enhance_adapter_src_set") { 174 branch_protector_ret = "pac_ret" 175 subsystem_name = "security" 176 part_name = "security_component_manager" 177 include_dirs = [ 178 "common/include", 179 "enhance_adapter/include", 180 "${sec_comp_root_dir}/interfaces/inner_api/security_component_common", 181 "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", 182 "${sec_comp_root_dir}/frameworks/inner_api/security_component/include", 183 ] 184 185 sources = [ "enhance_adapter/src/sec_comp_enhance_adapter.cpp" ] 186 187 configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] 188 public_configs = [ ":security_component_enhance_adapter_src_set_config" ] 189 190 external_deps = [ 191 "c_utils:utils", 192 "hilog:libhilog", 193 "ipc:ipc_single", 194 "json:nlohmann_json_static", 195 ] 196 197 cflags_cc = [ 198 "-DHILOG_ENABLE", 199 "-fvisibility=hidden", 200 ] 201} 202