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_enhance_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  ]
25}
26
27ohos_source_set("security_component_enhance_sdk_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  public_configs = [ ":sec_comp_enhance_config" ]
37
38  include_dirs = [
39    "include",
40    "${sec_comp_root_dir}/frameworks/common/include",
41    "${sec_comp_root_dir}/frameworks/enhance_adapter/include",
42  ]
43
44  sources = [ "src/sec_comp_enhance_kit.cpp" ]
45
46  deps = [ "${sec_comp_root_dir}/frameworks:security_component_enhance_adapter_src_set" ]
47
48  configs = [ "${sec_comp_root_dir}/config:coverage_flags" ]
49
50  external_deps = [
51    "c_utils:utils",
52    "hilog:libhilog",
53    "ipc:ipc_single",
54  ]
55
56  cflags_cc = [
57    "-DHILOG_ENABLE",
58    "-fvisibility=hidden",
59  ]
60}
61
62ohos_source_set("security_component_no_cfi_enhance_sdk_src_set") {
63  branch_protector_ret = "pac_ret"
64  subsystem_name = "security"
65  part_name = "security_component_manager"
66  public_configs = [ ":sec_comp_enhance_config" ]
67
68  include_dirs = [
69    "include",
70    "${sec_comp_root_dir}/frameworks/common/include",
71    "${sec_comp_root_dir}/frameworks/enhance_adapter/include",
72  ]
73
74  sources = [ "src/sec_comp_enhance_kit.cpp" ]
75
76  deps = [ "${sec_comp_root_dir}/frameworks:security_component_no_cfi_enhance_adapter_src_set" ]
77
78  configs = [ "${sec_comp_root_dir}/config:coverage_flags" ]
79
80  external_deps = [
81    "c_utils:utils",
82    "hilog:libhilog",
83    "ipc:ipc_single",
84  ]
85
86  cflags_cc = [
87    "-DHILOG_ENABLE",
88    "-fvisibility=hidden",
89  ]
90}
91