1# Copyright (C) 2021-2023 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("//base/security/huks/build/config.gni")
15import("//build/ohos.gni")
16
17if (os_level == "standard") {
18  ohos_static_library("libhuks_service_standard_static") {
19    subsystem_name = "security"
20    part_name = "huks"
21
22    public_deps = [
23      "//base/security/huks/services/huks_standard/huks_service/main/core:libhuks_service_core_standard_static",
24      "//base/security/huks/services/huks_standard/huks_service/main/os_dependency:libhuks_service_os_dependency_standard_static",
25    ]
26
27    complete_static_lib = true
28
29    branch_protector_ret = "pac_ret"
30
31    sanitize = {
32      integer_overflow = true
33      cfi = true
34      debug = false
35      cfi_cross_dso = true
36      boundary_sanitize = true
37      ubsan = true
38    }
39
40    configs = [
41      "//base/security/huks/frameworks/config/build:l2_standard_common_config",
42    ]
43    external_deps = [ "hilog:libhilog" ]
44  }
45
46  ohos_executable("hks_compatibility_bin") {
47    subsystem_name = "security"
48    part_name = "huks"
49    sanitize = {
50      integer_overflow = true
51      cfi = true
52      debug = false
53      cfi_cross_dso = true
54      boundary_sanitize = true
55      ubsan = true
56    }
57    branch_protector_ret = "pac_ret"
58    sources = [ "//base/security/huks/utils/compatibility_bin/compatibility_standard_bin.c" ]
59
60    cflags =
61        [ "-DHKS_CONFIG_RKC_STORE_PATH=\"${huks_use_rkc_in_standard_path}\"" ]
62    external_deps = [
63      "bounds_checking_function:libsec_static",
64      "hilog:libhilog",
65    ]
66    install_enable = true
67  }
68} else {
69  ohos_static_library("libhuks_service_small_static") {
70    public_deps = [
71      "//base/security/huks/services/huks_standard/huks_service/main/core:libhuks_service_core_small_static",
72
73      # "//base/security/huks/services/huks_standard/huks_service/main/os_dependency:libhuks_service_os_dependency_small_static",
74      "//base/security/huks/services/huks_standard/huks_service/main/os_dependency/idl:libhuks_service_idl_small_static",
75    ]
76    configs = [
77      "//base/security/huks/frameworks/config/build:l1_small_common_config",
78    ]
79
80    complete_static_lib = true
81
82    cflags = []
83
84    external_deps = [ "hilog_lite:hilog_shared" ]
85  }
86}
87