Pass c99 to compiler in CMakeLists.txt

Fixes #3631

Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
This commit is contained in:
okhowang(王沛文) 2020-09-03 16:21:30 +08:00 committed by Dave Rodgman
parent 5479f5321a
commit df865c349a
2 changed files with 8 additions and 0 deletions

View File

@ -18,6 +18,12 @@
*
* This file is part of mbed TLS (https://tls.mbed.org)
*/
#ifndef _BSD_SOURCE
#define _BSD_SOURCE
#endif
#ifndef _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#endif
#include "common.h"

View File

@ -170,6 +170,8 @@ string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}")
include(CheckCCompilerFlag)
set(CMAKE_C_STANDARD 99)
if(CMAKE_COMPILER_IS_GNU)
# some warnings we want are not available with old GCC versions
# note: starting with CMake 2.8 we could use CMAKE_C_COMPILER_VERSION