blob: efab789553382869ab4b20d03b8cff7c747d14b8 [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
Felix Conway998760a2025-03-24 11:37:33 +00009#define MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS
10
Bence Szépkútic662b362021-05-27 11:25:03 +020011#include "mbedtls/build_info.h"
Jaeden Ameroab83fdf2019-06-20 17:38:22 +010012
Jaeden Ameroab83fdf2019-06-20 17:38:22 +010013#include "mbedtls/platform.h"
Jaeden Ameroab83fdf2019-06-20 17:38:22 +010014
15#include "mbedtls/version.h"
16
17/* The main reason to build this is for testing the CMake build, so the program
18 * doesn't need to do very much. It calls a single library function to ensure
19 * linkage works, but that is all. */
20int main()
21{
22 /* This version string is 18 bytes long, as advised by version.h. */
23 char version[18];
24
Gilles Peskine449bd832023-01-11 14:50:10 +010025 mbedtls_version_get_string_full(version);
Jaeden Ameroab83fdf2019-06-20 17:38:22 +010026
Gilles Peskine449bd832023-01-11 14:50:10 +010027 mbedtls_printf("Built against %s\n", version);
Jaeden Ameroab83fdf2019-06-20 17:38:22 +010028
Gilles Peskine449bd832023-01-11 14:50:10 +010029 return 0;
Jaeden Ameroab83fdf2019-06-20 17:38:22 +010030}