1# 2# Copyright (c) 2020 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 16import("//build/lite/config/component/lite_component.gni") 17import("//build/lite/ndk/ndk.gni") 18import("//third_party/mbedtls/mbedtls.gni") 19 20config("mbedtls_config") { 21 include_dirs = [ "." ] + MBEDTLS_INLCUDE_DIRS 22 include_dirs += [ 23 "${beken_sdk_dir}/components/lwip_intf_v2_1/lwip-2.1.2/src/include", 24 "${beken_sdk_dir}/components/lwip_intf_v2_1/lwip-2.1.2/port", 25 "${beken_sdk_dir}/build/openharmony/${beken_chip_type}/armino_as_lib/include/common", 26 ] 27 28 defines += [ 29 "__unix__", 30 "MBEDTLS_CONFIG_FILE=<config/config_liteos_m.h>", 31 ] 32} 33 34lite_library("mbedtls_static") { 35 target_type = "static_library" 36 public_configs = [ ":mbedtls_config" ] 37 sources = MBEDTLS_SOURCES + [ "library/tls_hardware.c" ] 38} 39 40group("mbedtls") { 41 public_deps = [ ":mbedtls_static" ] 42 public_configs = [ ":mbedtls_config" ] 43} 44 45ndk_lib("mbedtls_ndk") { 46 lib_extension = ".a" 47 deps = [ ":mbedtls" ] 48 head_files = [ "include" ] 49} 50