blob: 8b4f18e288d10a9cd2acc8b6229cd6d06beeb464 [file] [log] [blame]
Jaeden Ameroab83fdf2019-06-20 17:38:22 +01001/*
2 * Simple program to test that CMake builds with Mbed TLS as a subdirectory
3 * work correctly.
4 *
Bence Szépkúti1e148272020-08-07 13:07:28 +02005 * Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +00006 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Jaeden Ameroab83fdf2019-06-20 17:38:22 +01007 */
8
Bence Szépkútic662b362021-05-27 11:25:03 +02009#include "mbedtls/build_info.h"
Jaeden Ameroab83fdf2019-06-20 17:38:22 +010010
Jaeden Ameroab83fdf2019-06-20 17:38:22 +010011#include "mbedtls/platform.h"
Jaeden Ameroab83fdf2019-06-20 17:38:22 +010012
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. */
18int main()
19{
20 /* This version string is 18 bytes long, as advised by version.h. */
21 char version[18];
22
Gilles Peskine449bd832023-01-11 14:50:10 +010023 mbedtls_version_get_string_full(version);
Jaeden Ameroab83fdf2019-06-20 17:38:22 +010024
Gilles Peskine449bd832023-01-11 14:50:10 +010025 mbedtls_printf("Built against %s\n", version);
Jaeden Ameroab83fdf2019-06-20 17:38:22 +010026
Gilles Peskine449bd832023-01-11 14:50:10 +010027 return 0;
Jaeden Ameroab83fdf2019-06-20 17:38:22 +010028}