mirror of
https://gitflic.ru/project/erthink/libmdbx.git
synced 2025-10-26 17:58:17 +00:00
mdbx-cmake: support of MDBX_USE_FALLOCATE for CMake and Conan.
This commit is contained in:
parent
a14fe7f195
commit
dc5f119de1
@ -705,6 +705,8 @@ mark_as_advanced(MDBX_ENABLE_PROFGC)
|
|||||||
add_option(MDBX ENABLE_DBI_SPARSE
|
add_option(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_option(MDBX ENABLE_DBI_LOCKFREE "Support for deferred releasing and a lockfree path to quickly open DBI handles" ON)
|
add_option(MDBX ENABLE_DBI_LOCKFREE "Support for deferred releasing and a lockfree path to quickly open DBI handles" ON)
|
||||||
|
add_option(MDBX USE_FALLOCATE "Using posix_fallocate() or fcntl(F_PREALLOCATE) on OSX" AUTO)
|
||||||
|
mark_as_advanced(MDBX_USE_FALLOCATE)
|
||||||
|
|
||||||
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")
|
||||||
|
|||||||
@ -82,6 +82,7 @@ class libmdbx(ConanFile):
|
|||||||
'mdbx.use_mincore': ['Auto', True, False],
|
'mdbx.use_mincore': ['Auto', True, False],
|
||||||
'mdbx.use_ofdlocks': ['Auto', True, False],
|
'mdbx.use_ofdlocks': ['Auto', True, False],
|
||||||
'mdbx.use_sendfile': ['Auto', True, False],
|
'mdbx.use_sendfile': ['Auto', True, False],
|
||||||
|
'mdbx.use_fallocate': ['Auto', True, False],
|
||||||
'mdbx.without_msvc_crt': ['Default', True, False],
|
'mdbx.without_msvc_crt': ['Default', True, False],
|
||||||
'shared': [True, False],
|
'shared': [True, False],
|
||||||
}
|
}
|
||||||
@ -113,6 +114,7 @@ class libmdbx(ConanFile):
|
|||||||
'mdbx.use_mincore': 'Auto',
|
'mdbx.use_mincore': 'Auto',
|
||||||
'mdbx.use_ofdlocks': 'Auto',
|
'mdbx.use_ofdlocks': 'Auto',
|
||||||
'mdbx.use_sendfile': 'Auto',
|
'mdbx.use_sendfile': 'Auto',
|
||||||
|
'mdbx.use_fallocate': 'Auto',
|
||||||
'mdbx.without_msvc_crt': 'Default',
|
'mdbx.without_msvc_crt': 'Default',
|
||||||
'shared': True,
|
'shared': True,
|
||||||
}
|
}
|
||||||
@ -143,7 +145,8 @@ class libmdbx(ConanFile):
|
|||||||
'mdbx.use_copyfilerange': 'Advanced: Use `copy_file_range()` syscall. ',
|
'mdbx.use_copyfilerange': 'Advanced: Use `copy_file_range()` syscall. ',
|
||||||
'mdbx.use_mincore': "Use Unix' `mincore()` to determine whether database pages are resident in memory. ",
|
'mdbx.use_mincore': "Use Unix' `mincore()` to determine whether database pages are resident in memory. ",
|
||||||
'mdbx.use_ofdlocks': 'Advanced: Use POSIX OFD-locks. ',
|
'mdbx.use_ofdlocks': 'Advanced: Use POSIX OFD-locks. ',
|
||||||
'mdbx.use_sendfile': 'Advancedc: Use `sendfile()` syscall. ',
|
'mdbx.use_sendfile': 'Advanced: Use `sendfile()` syscall. ',
|
||||||
|
'mdbx.use_fallocate': 'Advanced: Use posix_fallocate() or fcntl(F_PREALLOCATE) on OSX. ',
|
||||||
'mdbx.without_msvc_crt': 'Avoid dependence from MSVC CRT and use ntdll.dll instead. ',
|
'mdbx.without_msvc_crt': 'Avoid dependence from MSVC CRT and use ntdll.dll instead. ',
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,6 +163,7 @@ class libmdbx(ConanFile):
|
|||||||
self.options.rm_safe('mdbx.mmap_incoherent_file_write')
|
self.options.rm_safe('mdbx.mmap_incoherent_file_write')
|
||||||
self.options.rm_safe('mdbx.use_mincore')
|
self.options.rm_safe('mdbx.use_mincore')
|
||||||
self.options.rm_safe('mdbx.use_ofdlocks')
|
self.options.rm_safe('mdbx.use_ofdlocks')
|
||||||
|
self.options.rm_safe('mdbx.use_fallocate')
|
||||||
else:
|
else:
|
||||||
self.options.rm_safe('mdbx.without_msvc_crt')
|
self.options.rm_safe('mdbx.without_msvc_crt')
|
||||||
if is_apple_os(self):
|
if is_apple_os(self):
|
||||||
|
|||||||
@ -63,6 +63,11 @@
|
|||||||
|
|
||||||
#cmakedefine01 MDBX_USE_MINCORE
|
#cmakedefine01 MDBX_USE_MINCORE
|
||||||
|
|
||||||
|
#cmakedefine MDBX_USE_FALLOCATE_AUTO
|
||||||
|
#ifndef MDBX_USE_FALLOCATE_AUTO
|
||||||
|
#cmakedefine01 MDBX_USE_FALLOCATE
|
||||||
|
#endif /* MDBX_USE_FALLOCATE */
|
||||||
|
|
||||||
/* Build Info */
|
/* Build Info */
|
||||||
#ifndef MDBX_BUILD_TIMESTAMP
|
#ifndef MDBX_BUILD_TIMESTAMP
|
||||||
#cmakedefine MDBX_BUILD_TIMESTAMP "@MDBX_BUILD_TIMESTAMP@"
|
#cmakedefine MDBX_BUILD_TIMESTAMP "@MDBX_BUILD_TIMESTAMP@"
|
||||||
|
|||||||
@ -379,6 +379,7 @@ __dll_export
|
|||||||
#else /* Windows */
|
#else /* Windows */
|
||||||
" MDBX_LOCKING=" MDBX_LOCKING_CONFIG
|
" MDBX_LOCKING=" MDBX_LOCKING_CONFIG
|
||||||
" MDBX_USE_OFDLOCKS=" MDBX_USE_OFDLOCKS_CONFIG
|
" MDBX_USE_OFDLOCKS=" MDBX_USE_OFDLOCKS_CONFIG
|
||||||
|
" MDBX_USE_FALLOCATE=" MDBX_USE_FALLOCATE_CONFIG
|
||||||
#endif /* !Windows */
|
#endif /* !Windows */
|
||||||
" MDBX_CACHELINE_SIZE=" MDBX_STRINGIFY(MDBX_CACHELINE_SIZE)
|
" MDBX_CACHELINE_SIZE=" MDBX_STRINGIFY(MDBX_CACHELINE_SIZE)
|
||||||
" MDBX_CPU_WRITEBACK_INCOHERENT=" MDBX_STRINGIFY(MDBX_CPU_WRITEBACK_INCOHERENT)
|
" MDBX_CPU_WRITEBACK_INCOHERENT=" MDBX_STRINGIFY(MDBX_CPU_WRITEBACK_INCOHERENT)
|
||||||
|
|||||||
@ -358,7 +358,7 @@
|
|||||||
#error MDBX_USE_COPYFILERANGE must be defined as 0 or 1
|
#error MDBX_USE_COPYFILERANGE must be defined as 0 or 1
|
||||||
#endif /* MDBX_USE_COPYFILERANGE */
|
#endif /* MDBX_USE_COPYFILERANGE */
|
||||||
|
|
||||||
/** Advanced: Using posix_fallocate() or fcntl(F_PREALLOCATE) (autodetection by default). */
|
/** Advanced: Using posix_fallocate() or fcntl(F_PREALLOCATE) on OSX (autodetection by default). */
|
||||||
#ifndef MDBX_USE_FALLOCATE
|
#ifndef MDBX_USE_FALLOCATE
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
#define MDBX_USE_FALLOCATE 0 /* Too slow and unclean, but not required to prevent SIGBUS */
|
#define MDBX_USE_FALLOCATE 0 /* Too slow and unclean, but not required to prevent SIGBUS */
|
||||||
@ -367,8 +367,11 @@
|
|||||||
#else
|
#else
|
||||||
#define MDBX_USE_FALLOCATE 0
|
#define MDBX_USE_FALLOCATE 0
|
||||||
#endif
|
#endif
|
||||||
|
#define MDBX_USE_FALLOCATE_CONFIG "AUTO=" MDBX_STRINGIFY(MDBX_USE_FALLOCATE)
|
||||||
#elif !(MDBX_USE_FALLOCATE == 0 || MDBX_USE_FALLOCATE == 1)
|
#elif !(MDBX_USE_FALLOCATE == 0 || MDBX_USE_FALLOCATE == 1)
|
||||||
#error MDBX_USE_FALLOCATE must be defined as 0 or 1
|
#error MDBX_USE_FALLOCATE must be defined as 0 or 1
|
||||||
|
#else
|
||||||
|
#define MDBX_USE_FALLOCATE_CONFIG MDBX_STRINGIFY(MDBX_USE_FALLOCATE)
|
||||||
#endif /* MDBX_USE_FALLOCATE */
|
#endif /* MDBX_USE_FALLOCATE */
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user