1# 2# Copyright (c) 2020-2021 Huawei Device Co., Ltd. 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# 15 16hichian_sources = [ 17 "auth_info/add_auth_info.c", 18 "auth_info/add_auth_info_client.c", 19 "auth_info/auth_info.c", 20 "auth_info/exchange_auth_info.c", 21 "auth_info/exchange_auth_info_client.c", 22 "auth_info/remove_auth_info_client.c", 23 "hichain.c", 24 "huks_adapter/huks_adapter.c", 25 "json/commonutil.c", 26 "json/jsonutil.c", 27 "key_agreement/key_agreement.c", 28 "key_agreement/key_agreement_client.c", 29 "key_agreement/key_agreement_server.c", 30 "key_agreement/pake_client.c", 31 "key_agreement/pake_server.c", 32 "key_agreement/sec_clone_server.c", 33 "key_agreement/sts_client.c", 34 "key_agreement/sts_server.c", 35 "log/log.c", 36 "schedule/build_object.c", 37 "schedule/distribution.c", 38 "struct/add_auth_info_data.c", 39 "struct/add_auth_info_request.c", 40 "struct/add_auth_info_response.c", 41 "struct/auth_ack_request.c", 42 "struct/auth_ack_response.c", 43 "struct/auth_start_request.c", 44 "struct/auth_start_response.c", 45 "struct/exchange_auth_data.c", 46 "struct/exchange_request.c", 47 "struct/exchange_response.c", 48 "struct/import_add_auth_data.c", 49 "struct/inform_message.c", 50 "struct/key_agreement_version.c", 51 "struct/key_agreement_version.h", 52 "struct/pake_client_confirm.c", 53 "struct/pake_request.c", 54 "struct/pake_response.c", 55 "struct/pake_server_confirm.c", 56 "struct/parsedata.c", 57 "struct/rmv_auth_info_data.c", 58 "struct/rmv_auth_info_request.c", 59 "struct/rmv_auth_info_response.c", 60 "struct/sec_clone_data.c", 61] 62 63config("hichain_config") { 64 include_dirs = [ 65 "//third_party/bounds_checking_function/include", 66 "//base/security/device_auth/interfaces/inner_api/deviceauth_lite", 67 "//third_party/cJSON", 68 "base", 69 "huks_adapter", 70 "json", 71 "key_agreement", 72 "log", 73 "schedule", 74 "struct", 75 "auth_info", 76 ] 77 78 defines = [ 79 "_SCANTY_MEMORY_", 80 "_CUT_STS_CLIENT_", 81 "_CUT_REMOVE_", 82 "_CUT_ADD_", 83 "_CUT_LOG_", 84 ] 85} 86 87if (ohos_kernel_type == "liteos_m") { 88 static_library("hichainsdk") { 89 sources = hichian_sources 90 public_configs = [ ":hichain_config" ] 91 deps = 92 [ "//base/security/huks/interfaces/inner_api/huks_lite:huks_3.0_sdk" ] 93 if (board_toolchain_type == "iccarm") { 94 cflags = [ 95 "--diag_suppress", 96 "Pe1097,Pe546,Pe188,Pe111", 97 ] 98 } 99 } 100} else { 101 shared_library("hichainsdk") { 102 sources = hichian_sources 103 public_configs = [ ":hichain_config" ] 104 deps = [ 105 "//base/security/huks/interfaces/inner_api/huks_lite:huks_3.0_sdk", 106 "//build/lite/config/component/cJSON:cjson_shared", 107 "//third_party/bounds_checking_function:libsec_shared", 108 ] 109 cflags = [ 110 "-flto", 111 "-Wall", 112 "-fvisibility=hidden", 113 ] 114 } 115} 116