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