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
17config("huks_config") {
18  include_dirs = [ "include" ]
19}
20
21if (os_level == "standard") {
22  ohos_shared_library("libhukssdk") {
23    branch_protector_ret = "pac_ret"
24
25    sanitize = {
26      integer_overflow = true
27      cfi = true
28      debug = false
29      cfi_cross_dso = true
30      boundary_sanitize = true
31      ubsan = true
32    }
33    subsystem_name = "security"
34    part_name = "huks"
35    innerapi_tags = [
36      "platformsdk",
37      "sasdk",
38    ]
39    version_script = "libhukssdk.map"
40    public_configs = [ ":huks_config" ]
41    configs = [
42      "//base/security/huks/frameworks/config/build:l2_standard_common_config",
43    ]
44
45    include_dirs = [
46      "//base/security/huks/utils/crypto_adapter",
47      "../source",
48    ]
49    if (huks_security_level == "software") {
50      defines = [ "HKS_UNTRUSTED_RUNNING_ENV" ]
51    }
52    sources = [
53      "../source/hks_api.c",
54      "../source/hks_api_adapter.c",
55    ]
56
57    deps = [
58      "//base/security/huks/frameworks/huks_standard/main:huks_standard_frameworks",
59      "//base/security/huks/utils/crypto_adapter:libhuks_utils_client_service_adapter_static",
60    ]
61    external_deps = [
62      "c_utils:utils",
63      "hilog:libhilog",
64    ]
65  }
66}
67
68if (os_level == "small" || os_level == "mini") {
69  group("libhukssdk") {
70  }
71}
72