1# Copyright (c) 2022 Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK") 2# All rights reserved. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 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 + [ "src/mbedtls" ] 22 defines += [ 23 "__unix__", 24 "MBEDTLS_CONFIG_FILE=<telink_config/config_liteos_m.h>", 25 ] 26 27 configs = [ "../../../:B91_config" ] 28} 29 30lite_library("mbedtls_static") { 31 target_type = "static_library" 32 public_configs = [ ":mbedtls_config" ] 33 sources = MBEDTLS_SOURCES + [ 34 "src/mbedtls/internal/ecp_alt_b91_backend_test.c", 35 "src/mbedtls/internal/ecp_alt_b91_backend.c", 36 "src/mbedtls/internal/entropy_poll_alt.c", 37 "src/mbedtls/internal/multithread.c", 38 "src/mbedtls/internal/test_utils.c", 39 "src/mbedtls/internal/compatibility/aes_alt.c", 40 "src/mbedtls/internal/compatibility/ecp_alt.c", 41 "src/mbedtls/internal/compatibility/ecp_curves_alt.c", 42 ] 43} 44 45group("mbedtls") { 46 public_deps = [ ":mbedtls_static" ] 47 public_configs = [ ":mbedtls_config" ] 48} 49 50ndk_lib("mbedtls_ndk") { 51 lib_extension = ".a" 52 deps = [ ":mbedtls" ] 53 head_files = [ "include" ] 54} 55