mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-01-06 11:41:12 +03:00
Request C11 in CMake (but only for tests)
Set the C_STANDARD property on the mbedtls_test target to 11. This requests C11 for the tests only. If C11 is not supported the build will not fail, since C_STANDARD_REQUIRED is not set, and memory poisoning will be disabled by a preprocessor check on __STDC_VERSION__. Additionally, reintroduce previous C99 enforcement on the rest of the library. Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
@@ -78,6 +78,9 @@ foreach(exe IN LISTS executables_libs executables_mbedcrypto)
|
||||
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
# Request C11, required for memory poisoning
|
||||
set_target_properties(${exe} PROPERTIES C_STANDARD 11)
|
||||
|
||||
# This emulates "if ( ... IN_LIST ... )" which becomes available in CMake 3.3
|
||||
list(FIND executables_libs ${exe} exe_index)
|
||||
if (${exe_index} GREATER -1)
|
||||
|
||||
Reference in New Issue
Block a user