blob: 2498a738b6c4117001c4a3355c73861971258140 [file] [log] [blame]
Bence Szépkúti5ab73032021-05-27 11:25:03 +02001/**
2 * \file build_info.h
3 *
4 * \brief Build-time configuration info
5 *
6 * Include this file if you need to depend on the
Bence Szépkútibb0cfeb2021-05-28 09:42:25 +02007 * configuration options defined in mbedtls_config.h
Bence Szépkúti5ab73032021-05-27 11:25:03 +02008 */
9 /*
10 * Copyright The Mbed TLS Contributors
11 * SPDX-License-Identifier: Apache-2.0
12 *
13 * Licensed under the Apache License, Version 2.0 (the "License"); you may
14 * not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
21 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 */
25
26#ifndef MBEDTLS_BUILD_INFO_H
27#define MBEDTLS_BUILD_INFO_H
28
Bence Szépkútic5c9eb42021-05-27 23:31:30 +020029#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
30#define _CRT_SECURE_NO_DEPRECATE 1
31#endif
32
Bence Szépkúti5ab73032021-05-27 11:25:03 +020033#if !defined(MBEDTLS_CONFIG_FILE)
Bence Szépkútibb0cfeb2021-05-28 09:42:25 +020034#include "mbedtls/mbedtls_config.h"
Bence Szépkúti5ab73032021-05-27 11:25:03 +020035#else
36#include MBEDTLS_CONFIG_FILE
37#endif
38
Bence Szépkútiba7248a2021-05-31 16:53:56 +020039#if !defined(MBEDTLS_CONFIG_VERSION) || \
40 MBEDTLS_CONFIG_VERSION != 1
41#error "Invalid config version, MBEDTLS_CONFIG_VERSION != 1"
42#endif
43
Bence Szépkútic5c9eb42021-05-27 23:31:30 +020044/* Target and application specific configurations
45 *
46 * Allow user to override any previous default.
47 *
48 */
Bence Szépkútiba7248a2021-05-31 16:53:56 +020049#if defined(MBEDTLS_USER_CONFIG_VERSION)
50#error "MBEDTLS_USER_CONFIG_VERSION defined outside MBEDTLS_USER_CONFIG_FILE"
51#endif
52
Bence Szépkútic5c9eb42021-05-27 23:31:30 +020053#if defined(MBEDTLS_USER_CONFIG_FILE)
54#include MBEDTLS_USER_CONFIG_FILE
Bence Szépkútiba7248a2021-05-31 16:53:56 +020055#if !defined(MBEDTLS_USER_CONFIG_VERSION) || \
56 MBEDTLS_USER_CONFIG_VERSION != MBEDTLS_CONFIG_VERSION
57#error "Version mismatch between config file and MBEDTLS_USER_CONFIG_FILE"
58#endif
Bence Szépkútic5c9eb42021-05-27 23:31:30 +020059#endif
60
61#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
62#include "mbedtls/config_psa.h"
63#endif
64
65#include "mbedtls/check_config.h"
66
Bence Szépkúti5ab73032021-05-27 11:25:03 +020067#endif /* MBEDTLS_BUILD_INFO_H */