From a519d4617ed83a2167a693ae87934e56889fef05 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Thu, 8 Oct 2020 02:02:18 +0300 Subject: libmdbx: switch to original amalgamated source code (v0.9.1.18) Amalgamated source code is the recommended form for embedding libmdbx in non-CMake build systems. This amalgamated version contains a minimum of files, is fully ready for use, and make impossible a number of errors. To upgrade or switch to a different version, just unpack to the `src` subdirectory a corresponding `libmdbx-amalgamated-X_Y_Z.zip` at the https://github.com/erthink/libmdbx/releases. For instance, the https://github.com/erthink/libmdbx/releases/download/v0.9.2/libmdbx-amalgamated-0_9_2.zip for the next release. -- Minimal changes have been made to the build configuration: 1. For use the standard `DllMain()` entry of libmdbx: - added the `MDBX_BUILD_SHARED_LIBRARY=1` option; - removed the `MDBX_CONFIG_MANUAL_TLS_CALLBACK` option; - deleted the `miranda.c` file containing only `DllMain()` with the `mdbx_dll_handle()` call, now this is done by the library itself. 2. Removed refs to extra files (that missing in the amalgamated source code): - for building `libmdbx.dll` only the `mdbx.h` and `mdbx.c` are used, but not `mdbx.c++` for a C++ API; - for building the `mdbx_chk`, `mdbx_load`, and `mdbx_dump` utilities only it own sources are used. -- Last libmdbx changes: - Fixed missing installation of `mdbx.h++`. - Fixed use of obsolete `__noreturn`. - Fixed use of `yield` instruction on ARM if unsupported. - Added pthread workaround for buggy toolchain/cmake/buildroot. - Fixed use of `pthread_yield()` for non-GLIBC. - Fixed use of `RegGetValueA()` on Windows 2000/XP. - Fixed use of `GetTickCount64()` on Windows 2000/XP. - Fixed opening DB on a network shares (in the exclusive mode). - Fixed copy&paste typos. - Fixed minor false-positive GCC warning. --- libs/libmdbx/src/cmake/compiler.cmake | 19 ++++++++++--------- libs/libmdbx/src/cmake/utils.cmake | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'libs/libmdbx/src/cmake') diff --git a/libs/libmdbx/src/cmake/compiler.cmake b/libs/libmdbx/src/cmake/compiler.cmake index e13225d63d..ab72b897d1 100644 --- a/libs/libmdbx/src/cmake/compiler.cmake +++ b/libs/libmdbx/src/cmake/compiler.cmake @@ -231,7 +231,7 @@ else() check_compiler_flag("-ggdb" CC_HAS_GGDB) check_compiler_flag("-fvisibility=hidden" CC_HAS_VISIBILITY) check_compiler_flag("-march=native" CC_HAS_ARCH_NATIVE) - check_compiler_flag("-Og" CC_HAS_DEBUG_FRENDLY_OPTIMIZATION) + check_compiler_flag("-Og" CC_HAS_DEBUG_FRIENDLY_OPTIMIZATION) check_compiler_flag("-Wall" CC_HAS_WALL) check_compiler_flag("-Ominimal" CC_HAS_OMINIMAL) check_compiler_flag("-ffunction-sections -fdata-sections" CC_HAS_SECTIONS) @@ -606,8 +606,9 @@ macro(setup_compile_flags) if(MSVC_VERSION LESS 1900) message(FATAL_ERROR "At least \"Microsoft C/C++ Compiler\" version 19.0.24234.1 (Visual Studio 2015 Update 3) is required.") endif() - add_compile_flags("CXX" "/Zc:__cplusplus") - add_compile_flags("C;CXX" "/W4") + if(NOT MSVC_VERSION LESS 1910) + add_compile_flags("CXX" "/Zc:__cplusplus") + endif() add_compile_flags("C;CXX" "/utf-8") else() if(CC_HAS_WALL) @@ -771,14 +772,14 @@ endmacro(setup_compile_flags) if(CMAKE_CXX_COMPILER_LOADED) # determine library for for std::filesystem set(LIBCXX_FILESYSTEM "") - if(CMAKE_COMPILER_IS_GNUCXX) - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) - set(LIBCXX_FILESYSTEM "stdc++fs") - endif() - elseif(CMAKE_COMPILER_IS_CLANG) + if(CMAKE_COMPILER_IS_CLANG) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set(LIBCXX_FILESYSTEM "c++experimental") - else() + elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) + set(LIBCXX_FILESYSTEM "stdc++fs") + endif() + elseif(CMAKE_COMPILER_IS_GNUCXX) + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.3 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) set(LIBCXX_FILESYSTEM "stdc++fs") endif() endif() diff --git a/libs/libmdbx/src/cmake/utils.cmake b/libs/libmdbx/src/cmake/utils.cmake index 8e98267f4e..dc6a240e1b 100644 --- a/libs/libmdbx/src/cmake/utils.cmake +++ b/libs/libmdbx/src/cmake/utils.cmake @@ -155,7 +155,7 @@ macro(fetch_version name source_root_directory parent_scope) if(NOT ${name}_GIT_VERSION OR NOT ${name}_GIT_TIMESTAMP OR ${name}_GIT_REVISION STREQUAL "") if(GIT AND EXISTS "${source_root_directory}/.git") - message(WARNING "Unable to retrive ${name} version from git.") + message(WARNING "Unable to retrieve ${name} version from git.") endif() set(${name}_GIT_VERSION "0;0;0;0") set(${name}_GIT_TIMESTAMP "") @@ -168,7 +168,7 @@ macro(fetch_version name source_root_directory parent_scope) endif() if(NOT ${name}_VERSION) - message(WARNING "Unable to retrive ${name} version from \"${version_file}\" file.") + message(WARNING "Unable to retrieve ${name} version from \"${version_file}\" file.") set(${name}_VERSION_LIST ${${name}_GIT_VERSION}) string(REPLACE ";" "." ${name}_VERSION "${${name}_GIT_VERSION}") else() -- cgit v1.2.3