1526fd984Sopenharmony_ci#
2526fd984Sopenharmony_ci# Copyright (c) 2023-2023 Huawei Device Co., Ltd.
3526fd984Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
4526fd984Sopenharmony_ci# you may not use this file except in compliance with the License.
5526fd984Sopenharmony_ci# You may obtain a copy of the License at
6526fd984Sopenharmony_ci#
7526fd984Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
8526fd984Sopenharmony_ci#
9526fd984Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
10526fd984Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
11526fd984Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12526fd984Sopenharmony_ci# See the License for the specific language governing permissions and
13526fd984Sopenharmony_ci# limitations under the License.
14526fd984Sopenharmony_ci#
15526fd984Sopenharmony_ci
16526fd984Sopenharmony_ciimport("//base/security/huks/build/config.gni")
17526fd984Sopenharmony_ciimport("//build/ohos.gni")
18526fd984Sopenharmony_ci
19526fd984Sopenharmony_ciROOT_PATH = "../../../../../.."
20526fd984Sopenharmony_ci
21526fd984Sopenharmony_ciHUKS_PATH = "../../.."
22526fd984Sopenharmony_ci
23526fd984Sopenharmony_ciohos_static_library("ace_kit_huks") {
24526fd984Sopenharmony_ci  subsystem_name = "security"
25526fd984Sopenharmony_ci  part_name = "huks"
26526fd984Sopenharmony_ci
27526fd984Sopenharmony_ci  cflags = []
28526fd984Sopenharmony_ci  defines = []
29526fd984Sopenharmony_ci  if (huks_config_file != "") {
30526fd984Sopenharmony_ci    print(huks_config_file)
31526fd984Sopenharmony_ci    cflags += [ "-DHKS_CONFIG_FILE=\"${huks_config_file}\"" ]
32526fd984Sopenharmony_ci    cflags_cc = cflags
33526fd984Sopenharmony_ci  }
34526fd984Sopenharmony_ci
35526fd984Sopenharmony_ci  sources = [
36526fd984Sopenharmony_ci    "$HUKS_PATH/frameworks/huks_standard/main/common/src/hks_errcode_adapter.c",
37526fd984Sopenharmony_ci    "src/hks_lite_api.cpp",
38526fd984Sopenharmony_ci    "src/hks_lite_api_abort_session.cpp",
39526fd984Sopenharmony_ci    "src/hks_lite_api_common.cpp",
40526fd984Sopenharmony_ci    "src/hks_lite_api_delete_key_item.cpp",
41526fd984Sopenharmony_ci    "src/hks_lite_api_export_key_item.cpp",
42526fd984Sopenharmony_ci    "src/hks_lite_api_generate_key_item.cpp",
43526fd984Sopenharmony_ci    "src/hks_lite_api_get_key_properties.cpp",
44526fd984Sopenharmony_ci    "src/hks_lite_api_has_key_item.cpp",
45526fd984Sopenharmony_ci    "src/hks_lite_api_import_key_item.cpp",
46526fd984Sopenharmony_ci    "src/hks_lite_api_import_wrapped_key_item.cpp",
47526fd984Sopenharmony_ci    "src/hks_lite_api_init_session.cpp",
48526fd984Sopenharmony_ci    "src/hks_lite_api_is_key_item_exist.cpp",
49526fd984Sopenharmony_ci    "src/hks_lite_api_update_finish_session.cpp",
50526fd984Sopenharmony_ci  ]
51526fd984Sopenharmony_ci  deps = []
52526fd984Sopenharmony_ci  include_dirs = []
53526fd984Sopenharmony_ci
54526fd984Sopenharmony_ci  configs = [ "$ROOT_PATH/foundation/arkui/ace_engine_lite/frameworks/targets:ace_lite_target_config" ]
55526fd984Sopenharmony_ci
56526fd984Sopenharmony_ci  if (huks_enable_log == true) {
57526fd984Sopenharmony_ci    defines += [ "_HUKS_LOG_ENABLE_" ]
58526fd984Sopenharmony_ci    deps +=
59526fd984Sopenharmony_ci        [ "$ROOT_PATH/base/hiviewdfx/hilog_lite/frameworks/mini:hilog_lite" ]
60526fd984Sopenharmony_ci  }
61526fd984Sopenharmony_ci
62526fd984Sopenharmony_ci  include_dirs += [
63526fd984Sopenharmony_ci    "include",
64526fd984Sopenharmony_ci    "//third_party/bounds_checking_function/include",
65526fd984Sopenharmony_ci    "$ROOT_PATH/foundation/arkui/ace_engine_lite/interfaces/inner_api/builtin/jsi",
66526fd984Sopenharmony_ci    "$ROOT_PATH/foundation/arkui/ace_engine_lite/interfaces/inner_api/builtin/base",
67526fd984Sopenharmony_ci    "$ROOT_PATH/foundation/arkui/ace_engine_lite/frameworks/src/core/context",
68526fd984Sopenharmony_ci    "$ROOT_PATH/foundation/arkui/ace_engine_lite/interfaces/inner_api/builtin/async",
69526fd984Sopenharmony_ci    "$HUKS_PATH/frameworks/huks_standard/main/common/include",
70526fd984Sopenharmony_ci  ]
71526fd984Sopenharmony_ci  deps += [
72526fd984Sopenharmony_ci    "$HUKS_PATH/interfaces/inner_api/huks_lite:huks_3.0_sdk",
73526fd984Sopenharmony_ci    "$ROOT_PATH/foundation/arkui/ace_engine_lite/frameworks:ace_lite",
74526fd984Sopenharmony_ci    "//third_party/bounds_checking_function:libsec_shared",
75526fd984Sopenharmony_ci  ]
76526fd984Sopenharmony_ci}
77