1a8e1175bSopenharmony_ci/*
2a8e1175bSopenharmony_ci *  Simple program to test that CMake builds with Mbed TLS as a subdirectory
3a8e1175bSopenharmony_ci *  work correctly.
4a8e1175bSopenharmony_ci *
5a8e1175bSopenharmony_ci *  Copyright The Mbed TLS Contributors
6a8e1175bSopenharmony_ci *  SPDX-License-Identifier: Apache-2.0
7a8e1175bSopenharmony_ci *
8a8e1175bSopenharmony_ci *  Licensed under the Apache License, Version 2.0 (the "License"); you may
9a8e1175bSopenharmony_ci *  not use this file except in compliance with the License.
10a8e1175bSopenharmony_ci *  You may obtain a copy of the License at
11a8e1175bSopenharmony_ci *
12a8e1175bSopenharmony_ci *  http://www.apache.org/licenses/LICENSE-2.0
13a8e1175bSopenharmony_ci *
14a8e1175bSopenharmony_ci *  Unless required by applicable law or agreed to in writing, software
15a8e1175bSopenharmony_ci *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16a8e1175bSopenharmony_ci *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17a8e1175bSopenharmony_ci *  See the License for the specific language governing permissions and
18a8e1175bSopenharmony_ci *  limitations under the License.
19a8e1175bSopenharmony_ci */
20a8e1175bSopenharmony_ci
21a8e1175bSopenharmony_ci#include "mbedtls/build_info.h"
22a8e1175bSopenharmony_ci
23a8e1175bSopenharmony_ci#include "mbedtls/platform.h"
24a8e1175bSopenharmony_ci
25a8e1175bSopenharmony_ci#include "mbedtls/version.h"
26a8e1175bSopenharmony_ci
27a8e1175bSopenharmony_ci/* The main reason to build this is for testing the CMake build, so the program
28a8e1175bSopenharmony_ci * doesn't need to do very much. It calls a single library function to ensure
29a8e1175bSopenharmony_ci * linkage works, but that is all. */
30a8e1175bSopenharmony_ciint main()
31a8e1175bSopenharmony_ci{
32a8e1175bSopenharmony_ci    /* This version string is 18 bytes long, as advised by version.h. */
33a8e1175bSopenharmony_ci    char version[18];
34a8e1175bSopenharmony_ci
35a8e1175bSopenharmony_ci    mbedtls_version_get_string_full(version);
36a8e1175bSopenharmony_ci
37a8e1175bSopenharmony_ci    mbedtls_printf("Built against %s\n", version);
38a8e1175bSopenharmony_ci
39a8e1175bSopenharmony_ci    return 0;
40a8e1175bSopenharmony_ci}
41