mdbx-cmake: очистка условий включения стандартов C и C++.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2024-11-09 23:02:56 +03:00
parent bd7b272bca
commit 9b9d6c6d65
2 changed files with 7 additions and 5 deletions

View File

@ -804,13 +804,15 @@ macro(target_setup_options TARGET)
set_target_properties(${TARGET} PROPERTIES set_target_properties(${TARGET} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION $<BOOL:${INTERPROCEDURAL_OPTIMIZATION}>) INTERPROCEDURAL_OPTIMIZATION $<BOOL:${INTERPROCEDURAL_OPTIMIZATION}>)
endif() endif()
if(NOT MDBX_C_STANDARD EQUAL 11 OR (NOT C_FALLBACK_GNU11 AND NOT C_FALLBACK_11)) if(NOT C_FALLBACK_GNU11 AND NOT C_FALLBACK_11)
set_target_properties(${TARGET} PROPERTIES set_target_properties(${TARGET} PROPERTIES
C_STANDARD ${MDBX_C_STANDARD} C_STANDARD_REQUIRED ON) C_STANDARD ${MDBX_C_STANDARD} C_STANDARD_REQUIRED ON)
endif() endif()
if(MDBX_BUILD_CXX) if(MDBX_BUILD_CXX)
set_target_properties(${TARGET} PROPERTIES if(NOT CXX_FALLBACK_GNU11 AND NOT CXX_FALLBACK_11)
CXX_STANDARD ${MDBX_CXX_STANDARD} CXX_STANDARD_REQUIRED ON) set_target_properties(${TARGET} PROPERTIES
CXX_STANDARD ${MDBX_CXX_STANDARD} CXX_STANDARD_REQUIRED ON)
endif()
if(MSVC AND NOT MSVC_VERSION LESS 1910) if(MSVC AND NOT MSVC_VERSION LESS 1910)
target_compile_options(${TARGET} INTERFACE "/Zc:__cplusplus") target_compile_options(${TARGET} INTERFACE "/Zc:__cplusplus")
endif() endif()

View File

@ -386,7 +386,7 @@ endif()
if(CMAKE_CXX_COMPILER_LOADED) if(CMAKE_CXX_COMPILER_LOADED)
list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_std_11 HAS_CXX11) list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_std_11 HAS_CXX11)
if(HAS_CXX11 LESS 0) if(HAS_CXX11 LESS 0)
if (MSVC) if(MSVC)
check_cxx_compiler_flag("/std:c++11" CXX_FALLBACK_11) check_cxx_compiler_flag("/std:c++11" CXX_FALLBACK_11)
else() else()
check_cxx_compiler_flag("-std=gnu++11" CXX_FALLBACK_GNU11) check_cxx_compiler_flag("-std=gnu++11" CXX_FALLBACK_GNU11)
@ -401,7 +401,7 @@ endif()
if(CMAKE_C_COMPILER_LOADED) if(CMAKE_C_COMPILER_LOADED)
list(FIND CMAKE_C_COMPILE_FEATURES c_std_11 HAS_C11) list(FIND CMAKE_C_COMPILE_FEATURES c_std_11 HAS_C11)
if(HAS_C11 LESS 0) if(HAS_C11 LESS 0)
if (MSVC) if(MSVC)
check_c_compiler_flag("/std:c11" C_FALLBACK_11) check_c_compiler_flag("/std:c11" C_FALLBACK_11)
else() else()
check_c_compiler_flag("-std=gnu11" C_FALLBACK_GNU11) check_c_compiler_flag("-std=gnu11" C_FALLBACK_GNU11)