1# Copyright 2020 Google LLC 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://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, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15import("//build_overrides/pigweed.gni") 16import("$dir_pw_build/target_types.gni") 17 18config("external_config") { 19 include_dirs = [ "src/include" ] 20} 21 22config("internal_config") { 23 visibility = [ ":*" ] # Only targets in this file can depend on this. 24 defines = [ "MBEDTLS_CONFIG_FILE=\"custom_config.h\"" ] 25 include_dirs = [ get_path_info(get_path_info("BUILD.gn", "abspath"), "dir") ] 26 cflags = [ "-Wno-cast-qual" ] 27} 28 29pw_static_library("mbedcrypto") { 30 sources = [ 31 "src/library/asn1parse.c", 32 "src/library/asn1write.c", 33 "src/library/bignum.c", 34 "src/library/bignum_core.c", 35 "src/library/constant_time.c", 36 "src/library/ecdsa.c", 37 "src/library/ecp.c", 38 "src/library/ecp_curves.c", 39 "src/library/hash_info.c", 40 "src/library/hkdf.c", 41 "src/library/hmac_drbg.c", 42 "src/library/md.c", 43 "src/library/oid.c", 44 "src/library/pk.c", 45 "src/library/pk_wrap.c", 46 "src/library/pkwrite.c", 47 "src/library/platform_util.c", 48 "src/library/sha512.c", 49 "src/library/x509_create.c", 50 "src/library/x509write_crt.c", 51 ] 52 53 public_configs = [ ":external_config" ] 54 configs = [ ":internal_config" ] 55} 56