mdbx-cmake: require C99 or use C11 when available.

Change-Id: I241e8c38232750efb537a0b581f822540f207cdc
This commit is contained in:
Leonid Yuriev
2019-10-22 12:14:26 +03:00
parent 83a0c31b35
commit 70350bad81
5 changed files with 37 additions and 12 deletions

View File

@@ -272,7 +272,13 @@ else()
setup_compile_flags()
endif(SUBPROJECT)
option(MDBX_ENABLE_TESTS "Build MDBX tests." ${BUILD_TESTING})
list(FIND CMAKE_C_COMPILE_FEATURES c_std_11 HAS_C11)
if(NOT HAS_C11 LESS 0)
set(MDBX_C_STANDARD 11)
else()
set(MDBX_C_STANDARD 99)
endif()
message(STATUS "Use C${MDBX_C_STANDARD} for libmdbx")
##############################################################################
##############################################################################
@@ -312,6 +318,7 @@ else()
add_mdbx_option(MDBX_USE_OFDLOCKS "Use Open file description locks (aka OFD locks, non-POSIX)" AUTO)
mark_as_advanced(MDBX_USE_OFDLOCKS)
endif()
option(MDBX_ENABLE_TESTS "Build MDBX tests." ${BUILD_TESTING})
################################################################################
################################################################################