mdbx-cmake: удаление add_mdbx_option().

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2024-12-12 13:07:49 +03:00
parent 513518ca5e
commit ea3f99f58f

View File

@ -621,14 +621,6 @@ endif()
# ###################################################################################################################### # ######################################################################################################################
set(MDBX_BUILD_OPTIONS ENABLE_UBSAN ENABLE_ASAN ENABLE_MEMCHECK ENABLE_GPROF ENABLE_GCOV) set(MDBX_BUILD_OPTIONS ENABLE_UBSAN ENABLE_ASAN ENABLE_MEMCHECK ENABLE_GPROF ENABLE_GCOV)
macro(add_mdbx_option NAME DESCRIPTION DEFAULT)
list(APPEND MDBX_BUILD_OPTIONS ${NAME})
if(NOT ${DEFAULT} STREQUAL "AUTO")
option(${NAME} "${DESCRIPTION}" ${DEFAULT})
elseif(NOT DEFINED ${NAME})
set(${NAME}_AUTO ON)
endif()
endmacro()
if(IOS) if(IOS)
set(MDBX_BUILD_TOOLS_DEFAULT OFF) set(MDBX_BUILD_TOOLS_DEFAULT OFF)
@ -640,64 +632,60 @@ else()
set(MDBX_BUILD_TOOLS_DEFAULT ON) set(MDBX_BUILD_TOOLS_DEFAULT ON)
endif() endif()
add_mdbx_option(MDBX_INSTALL_STATIC "Build and install libmdbx for static linking" OFF) add_option(MDBX INSTALL_STATIC "Build and install libmdbx for static linking" OFF)
add_mdbx_option(MDBX_BUILD_SHARED_LIBRARY "Build libmdbx as shared library (DLL)" ${BUILD_SHARED_LIBS}) add_option(MDBX BUILD_SHARED_LIBRARY "Build libmdbx as shared library (DLL)" ${BUILD_SHARED_LIBS})
add_mdbx_option(MDBX_BUILD_TOOLS "Build MDBX tools (mdbx_chk/stat/dump/load/copy/drop)" ${MDBX_BUILD_TOOLS_DEFAULT}) add_option(MDBX BUILD_TOOLS "Build MDBX tools (mdbx_chk/stat/dump/load/copy/drop)" ${MDBX_BUILD_TOOLS_DEFAULT})
cmake_dependent_option(MDBX_INSTALL_MANPAGES "Install man-pages for MDBX tools (mdbx_chk/stat/dump/load/copy)" ON cmake_dependent_option(MDBX_INSTALL_MANPAGES "Install man-pages for MDBX tools (mdbx_chk/stat/dump/load/copy)" ON
MDBX_BUILD_TOOLS OFF) MDBX_BUILD_TOOLS OFF)
add_mdbx_option(MDBX_TXN_CHECKOWNER "Checking transaction matches the calling thread inside libmdbx's API" ON) add_option(MDBX TXN_CHECKOWNER "Checking transaction matches the calling thread inside libmdbx's API" ON)
add_mdbx_option(MDBX_ENV_CHECKPID "Checking PID inside libmdbx's API against reuse DB environment after the fork()" add_option(MDBX ENV_CHECKPID "Checking PID inside libmdbx's API against reuse DB environment after the fork()" AUTO)
AUTO)
mark_as_advanced(MDBX_ENV_CHECKPID) mark_as_advanced(MDBX_ENV_CHECKPID)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_mdbx_option(MDBX_DISABLE_GNU_SOURCE "Don't use GNU/Linux libc extensions" OFF) add_option(MDBX DISABLE_GNU_SOURCE "Don't use GNU/Linux libc extensions" OFF)
mark_as_advanced(MDBX_DISABLE_GNU_SOURCE) mark_as_advanced(MDBX_DISABLE_GNU_SOURCE)
endif() endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR IOS) if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR IOS)
add_mdbx_option(MDBX_APPLE_SPEED_INSTEADOF_DURABILITY "Disable use fcntl(F_FULLFSYNC) in favor of speed" OFF) add_option(MDBX APPLE_SPEED_INSTEADOF_DURABILITY "Disable use fcntl(F_FULLFSYNC) in favor of speed" OFF)
mark_as_advanced(MDBX_APPLE_SPEED_INSTEADOF_DURABILITY) mark_as_advanced(MDBX_APPLE_SPEED_INSTEADOF_DURABILITY)
endif() endif()
if(WIN32) if(WIN32)
if(MDBX_NTDLL_EXTRA_IMPLIB) if(MDBX_NTDLL_EXTRA_IMPLIB)
add_mdbx_option(MDBX_WITHOUT_MSVC_CRT "Avoid dependence from MSVC CRT and use ntdll.dll instead" OFF) add_option(MDBX WITHOUT_MSVC_CRT "Avoid dependence from MSVC CRT and use ntdll.dll instead" OFF)
endif() endif()
set(MDBX_AVOID_MSYNC_DEFAULT ON) set(MDBX_AVOID_MSYNC_DEFAULT ON)
else() else()
add_mdbx_option(MDBX_USE_OFDLOCKS "Use Open file description locks (aka OFD locks, non-POSIX)" AUTO) add_option(MDBX USE_OFDLOCKS "Use Open file description locks (aka OFD locks, non-POSIX)" AUTO)
mark_as_advanced(MDBX_USE_OFDLOCKS) mark_as_advanced(MDBX_USE_OFDLOCKS)
add_mdbx_option(MDBX_USE_MINCORE "Use Unix' mincore() to determine whether DB-pages are resident in memory" ON) add_option(MDBX USE_MINCORE "Use Unix' mincore() to determine whether DB-pages are resident in memory" ON)
mark_as_advanced(MDBX_USE_MINCORE) mark_as_advanced(MDBX_USE_MINCORE)
set(MDBX_AVOID_MSYNC_DEFAULT OFF) set(MDBX_AVOID_MSYNC_DEFAULT OFF)
endif() endif()
add_mdbx_option( add_option(
MDBX_AVOID_MSYNC MDBX AVOID_MSYNC
"Disable in-memory database updating with consequent flush-to-disk/msync syscall in `MDBX_WRITEMAP` mode" "Disable in-memory database updating with consequent flush-to-disk/msync syscall in `MDBX_WRITEMAP` mode"
${MDBX_AVOID_MSYNC_DEFAULT}) ${MDBX_AVOID_MSYNC_DEFAULT})
add_mdbx_option(MDBX_MMAP_NEEDS_JOLT "Assume system needs explicit syscall to sync/flush/write modified mapped memory" add_option(MDBX MMAP_NEEDS_JOLT "Assume system needs explicit syscall to sync/flush/write modified mapped memory" AUTO)
AUTO)
mark_as_advanced(MDBX_MMAP_NEEDS_JOLT) mark_as_advanced(MDBX_MMAP_NEEDS_JOLT)
add_mdbx_option(MDBX_LOCKING "Locking method (Windows=-1, SystemV=5, POSIX=1988, POSIX=2001, POSIX=2008)" AUTO) add_option(MDBX LOCKING "Locking method (Windows=-1, SystemV=5, POSIX=1988, POSIX=2001, POSIX=2008)" AUTO)
mark_as_advanced(MDBX_LOCKING) mark_as_advanced(MDBX_LOCKING)
add_mdbx_option(MDBX_TRUST_RTC "Does a system have battery-backed Real-Time Clock or just a fake" AUTO) add_option(MDBX TRUST_RTC "Does a system have battery-backed Real-Time Clock or just a fake" AUTO)
mark_as_advanced(MDBX_TRUST_RTC) mark_as_advanced(MDBX_TRUST_RTC)
add_mdbx_option(MDBX_FORCE_ASSERTIONS "Force enable assertion checking" OFF) add_option(MDBX FORCE_ASSERTIONS "Force enable assertion checking" OFF)
add_mdbx_option( add_option(
MDBX_DISABLE_VALIDATION MDBX
DISABLE_VALIDATION
"Disable some checks to reduce an overhead and detection probability of database corruption to a values closer to the LMDB" "Disable some checks to reduce an overhead and detection probability of database corruption to a values closer to the LMDB"
OFF) OFF)
mark_as_advanced(MDBX_DISABLE_VALIDATION) mark_as_advanced(MDBX_DISABLE_VALIDATION)
add_mdbx_option(MDBX_ENABLE_REFUND "Zerocost auto-compactification during write-transactions" ON) add_option(MDBX ENABLE_REFUND "Zerocost auto-compactification during write-transactions" ON)
add_mdbx_option( add_option(MDBX ENABLE_BIGFOOT
MDBX_ENABLE_BIGFOOT
"Chunking long list of retired pages during huge transactions commit to avoid use sequences of pages" ON) "Chunking long list of retired pages during huge transactions commit to avoid use sequences of pages" ON)
add_mdbx_option(MDBX_ENABLE_PGOP_STAT "Gathering statistics for page operations" ON) add_option(MDBX ENABLE_PGOP_STAT "Gathering statistics for page operations" ON)
add_mdbx_option(MDBX_ENABLE_PROFGC "Profiling of GC search and updates" OFF) add_option(MDBX ENABLE_PROFGC "Profiling of GC search and updates" OFF)
mark_as_advanced(MDBX_ENABLE_PROFGC) mark_as_advanced(MDBX_ENABLE_PROFGC)
add_mdbx_option( add_option(MDBX ENABLE_DBI_SPARSE
MDBX_ENABLE_DBI_SPARSE
"Support for sparse sets of DBI handles to reduce overhead when starting and processing transactions" ON) "Support for sparse sets of DBI handles to reduce overhead when starting and processing transactions" ON)
add_mdbx_option(MDBX_ENABLE_DBI_LOCKFREE add_option(MDBX ENABLE_DBI_LOCKFREE "Support for deferred releasing and a lockfree path to quickly open DBI handles" ON)
"Support for deferred releasing and a lockfree path to quickly open DBI handles" ON)
if(NOT MDBX_AMALGAMATED_SOURCE) if(NOT MDBX_AMALGAMATED_SOURCE)
if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE_UPPERCASE STREQUAL "DEBUG") if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE_UPPERCASE STREQUAL "DEBUG")
@ -705,11 +693,11 @@ if(NOT MDBX_AMALGAMATED_SOURCE)
else() else()
set(MDBX_ALLOY_BUILD_DEFAULT ON) set(MDBX_ALLOY_BUILD_DEFAULT ON)
endif() endif()
add_mdbx_option(MDBX_ALLOY_BUILD "Build MDBX library through single/alloyed object file" ${MDBX_ALLOY_BUILD_DEFAULT}) add_option(MDBX ALLOY_BUILD "Build MDBX library through single/alloyed object file" ${MDBX_ALLOY_BUILD_DEFAULT})
endif() endif()
if((MDBX_BUILD_TOOLS OR MDBX_ENABLE_TESTS) AND MDBX_BUILD_SHARED_LIBRARY) if((MDBX_BUILD_TOOLS OR MDBX_ENABLE_TESTS) AND MDBX_BUILD_SHARED_LIBRARY)
add_mdbx_option(MDBX_LINK_TOOLS_NONSTATIC "Link MDBX tools with non-static libmdbx" OFF) add_option(MDBX LINK_TOOLS_NONSTATIC "Link MDBX tools with non-static libmdbx" OFF)
else() else()
unset(MDBX_LINK_TOOLS_NONSTATIC CACHE) unset(MDBX_LINK_TOOLS_NONSTATIC CACHE)
endif() endif()