mdbx-cmake: add MDBX_MANAGE_BUILD_FLAGS build-time option.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2022-07-28 18:48:21 +03:00
parent c06d072daf
commit a44eb1accb

View File

@ -233,6 +233,7 @@ if(SUBPROJECT)
if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
option(CMAKE_POSITION_INDEPENDENT_CODE "Generate position independent (PIC)" ON)
endif()
set(MDBX_MANAGE_BUILD_FLAGS_DEFAULT OFF)
else()
option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)" ON)
option(CMAKE_POSITION_INDEPENDENT_CODE "Generate position independent (PIC)" ON)
@ -341,9 +342,14 @@ else()
endif()
endif(NOT MDBX_AMALGAMATED_SOURCE)
setup_compile_flags()
set(MDBX_MANAGE_BUILD_FLAGS_DEFAULT ON)
endif(SUBPROJECT)
option(MDBX_MANAGE_BUILD_FLAGS "Allow libmdbx to configure/manage/override its own build flags" ${MDBX_MANAGE_BUILD_FLAGS_DEFAULT})
if(MDBX_MANAGE_BUILD_FLAGS)
setup_compile_flags()
endif()
list(FIND CMAKE_C_COMPILE_FEATURES c_std_11 HAS_C11)
list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_std_11 HAS_CXX11)
list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_std_14 HAS_CXX14)