mirror of
https://github.com/isar/libmdbx.git
synced 2025-11-07 07:18:56 +08:00
mdbx-cmake: support of MDBX_USE_FALLOCATE for CMake and Conan.
This commit is contained in:
@@ -63,6 +63,11 @@
|
||||
|
||||
#cmakedefine01 MDBX_USE_MINCORE
|
||||
|
||||
#cmakedefine MDBX_USE_FALLOCATE_AUTO
|
||||
#ifndef MDBX_USE_FALLOCATE_AUTO
|
||||
#cmakedefine01 MDBX_USE_FALLOCATE
|
||||
#endif /* MDBX_USE_FALLOCATE */
|
||||
|
||||
/* Build Info */
|
||||
#ifndef MDBX_BUILD_TIMESTAMP
|
||||
#cmakedefine MDBX_BUILD_TIMESTAMP "@MDBX_BUILD_TIMESTAMP@"
|
||||
|
||||
@@ -379,6 +379,7 @@ __dll_export
|
||||
#else /* Windows */
|
||||
" MDBX_LOCKING=" MDBX_LOCKING_CONFIG
|
||||
" MDBX_USE_OFDLOCKS=" MDBX_USE_OFDLOCKS_CONFIG
|
||||
" MDBX_USE_FALLOCATE=" MDBX_USE_FALLOCATE_CONFIG
|
||||
#endif /* !Windows */
|
||||
" MDBX_CACHELINE_SIZE=" MDBX_STRINGIFY(MDBX_CACHELINE_SIZE)
|
||||
" 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
|
||||
#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
|
||||
#if defined(__APPLE__)
|
||||
#define MDBX_USE_FALLOCATE 0 /* Too slow and unclean, but not required to prevent SIGBUS */
|
||||
@@ -367,8 +367,11 @@
|
||||
#else
|
||||
#define MDBX_USE_FALLOCATE 0
|
||||
#endif
|
||||
#define MDBX_USE_FALLOCATE_CONFIG "AUTO=" MDBX_STRINGIFY(MDBX_USE_FALLOCATE)
|
||||
#elif !(MDBX_USE_FALLOCATE == 0 || MDBX_USE_FALLOCATE == 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 */
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user