Jaeden Amero | ab83fdf | 2019-06-20 17:38:22 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Simple program to test that CMake builds with Mbed TLS as a subdirectory |
| 3 | * work correctly. |
| 4 | * |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | * Copyright The Mbed TLS Contributors |
Dave Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame^] | 6 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Jaeden Amero | ab83fdf | 2019-06-20 17:38:22 +0100 | [diff] [blame] | 7 | */ |
| 8 | |
Bence Szépkúti | c662b36 | 2021-05-27 11:25:03 +0200 | [diff] [blame] | 9 | #include "mbedtls/build_info.h" |
Jaeden Amero | ab83fdf | 2019-06-20 17:38:22 +0100 | [diff] [blame] | 10 | |
Jaeden Amero | ab83fdf | 2019-06-20 17:38:22 +0100 | [diff] [blame] | 11 | #include "mbedtls/platform.h" |
Jaeden Amero | ab83fdf | 2019-06-20 17:38:22 +0100 | [diff] [blame] | 12 | |
| 13 | #include "mbedtls/version.h" |
| 14 | |
| 15 | /* The main reason to build this is for testing the CMake build, so the program |
| 16 | * doesn't need to do very much. It calls a single library function to ensure |
| 17 | * linkage works, but that is all. */ |
| 18 | int main() |
| 19 | { |
| 20 | /* This version string is 18 bytes long, as advised by version.h. */ |
| 21 | char version[18]; |
| 22 | |
Gilles Peskine | 449bd83 | 2023-01-11 14:50:10 +0100 | [diff] [blame] | 23 | mbedtls_version_get_string_full(version); |
Jaeden Amero | ab83fdf | 2019-06-20 17:38:22 +0100 | [diff] [blame] | 24 | |
Gilles Peskine | 449bd83 | 2023-01-11 14:50:10 +0100 | [diff] [blame] | 25 | mbedtls_printf("Built against %s\n", version); |
Jaeden Amero | ab83fdf | 2019-06-20 17:38:22 +0100 | [diff] [blame] | 26 | |
Gilles Peskine | 449bd83 | 2023-01-11 14:50:10 +0100 | [diff] [blame] | 27 | return 0; |
Jaeden Amero | ab83fdf | 2019-06-20 17:38:22 +0100 | [diff] [blame] | 28 | } |