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("sec_comp_config") {
19  visibility = [ ":*" ]
20  include_dirs = [
21    "include",
22    "${sec_comp_root_dir}/frameworks/common/include",
23    "${sec_comp_root_dir}/frameworks/enhance_adapter/include/",
24    "${sec_comp_root_dir}/interfaces/inner_api/enhance_kits/include",
25  ]
26}
27
28ohos_shared_library("libsecurity_component_sdk") {
29  branch_protector_ret = "pac_ret"
30  subsystem_name = "security"
31  part_name = "security_component_manager"
32  output_name = "libsecurity_component_sdk"
33
34  public_configs = [ ":sec_comp_config" ]
35
36  include_dirs = [
37    "include",
38    "${sec_comp_root_dir}/frameworks/common/include",
39    "${sec_comp_root_dir}/frameworks/enhance_adapter/include/",
40    "${sec_comp_root_dir}/interfaces/inner_api/enhance_kits/include",
41    "${sec_comp_root_dir}/frameworks/security_component/include",
42  ]
43
44  sources = [
45    "src/sec_comp_caller_authorization.cpp",
46    "src/sec_comp_client.cpp",
47    "src/sec_comp_death_recipient.cpp",
48    "src/sec_comp_dialog_callback.cpp",
49    "src/sec_comp_dialog_callback_stub.cpp",
50    "src/sec_comp_kit.cpp",
51    "src/sec_comp_load_callback.cpp",
52    "src/sec_comp_proxy.cpp",
53    "src/sec_comp_ui_register.cpp",
54  ]
55
56  deps = [
57    "${sec_comp_root_dir}/frameworks:security_component_no_cfi_enhance_adapter_src_set",
58    "${sec_comp_root_dir}/frameworks:security_component_no_cfi_framework_src_set",
59    "${sec_comp_root_dir}/interfaces/inner_api/enhance_kits:security_component_no_cfi_enhance_sdk_src_set",
60  ]
61
62  configs = [ "${sec_comp_root_dir}/config:coverage_flags" ]
63
64  external_deps = [
65    "access_token:libaccesstoken_sdk",
66    "bundle_framework:appexecfwk_core",
67    "c_utils:utils",
68    "hilog:libhilog",
69    "hisysevent:libhisysevent",
70    "ipc:ipc_core",
71    "samgr:samgr_proxy",
72  ]
73
74  public_external_deps = [ "json:nlohmann_json_static" ]
75
76  cflags_cc = [
77    "-DHILOG_ENABLE",
78    "-fvisibility=hidden",
79  ]
80}
81