|
13 | 13 | # |
14 | 14 | # The next version is under active non-public development and will be released as MithrilDB and libmithrildb for |
15 | 15 | # libraries & packages. Admittedly mythical Mithril is resembling silver but being stronger and lighter than steel. |
16 | | -# Therefore MithrilDB is rightly relevant name. |
17 | | -# MithrilDB will be radically different from libmdbx by the new database format and API based on C++20. |
18 | | -# The goal of this revolution is to provide a clearer and robust API, add more features and new valuable properties. |
| 16 | +# Therefore MithrilDB is rightly relevant name. MithrilDB will be radically different from libmdbx by the new database |
| 17 | +# format and API based on C++20. The goal of this revolution is to provide a clearer and robust API, add more features |
| 18 | +# and new valuable properties. |
19 | 19 |
|
20 | 20 | if(CMAKE_VERSION VERSION_LESS 3.8.2) |
21 | 21 | cmake_minimum_required(VERSION 3.0.2) |
@@ -54,23 +54,23 @@ endif() |
54 | 54 | cmake_policy(SET CMP0054 NEW) |
55 | 55 |
|
56 | 56 | if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.json" |
57 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/COPYRIGHT" |
58 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" |
59 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/NOTICE" |
60 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/README.md" |
61 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/GNUmakefile" |
62 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx.c" |
63 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx.c++" |
64 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx.h" |
65 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx.h++" |
66 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx_chk.c" |
67 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx_copy.c" |
68 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx_dump.c" |
69 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx_load.c" |
70 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx_stat.c" |
71 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx_drop.c" |
72 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ntdll.def" |
73 | | - AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/config.h.in") |
| 57 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/COPYRIGHT" |
| 58 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" |
| 59 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/NOTICE" |
| 60 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/README.md" |
| 61 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/GNUmakefile" |
| 62 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx.c" |
| 63 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx.c++" |
| 64 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx.h" |
| 65 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx.h++" |
| 66 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx_chk.c" |
| 67 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx_copy.c" |
| 68 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx_dump.c" |
| 69 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx_load.c" |
| 70 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx_stat.c" |
| 71 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mdbx_drop.c" |
| 72 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ntdll.def" |
| 73 | + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/config.h.in") |
74 | 74 | set(MDBX_AMALGAMATED_SOURCE TRUE) |
75 | 75 | set(MDBX_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") |
76 | 76 | else() |
@@ -130,8 +130,7 @@ endif() |
130 | 130 | # Try to find a C++ compiler unless sure that this is unnecessary. |
131 | 131 | if(NOT CMAKE_CXX_COMPILER_LOADED) |
132 | 132 | include(CheckLanguage) |
133 | | - if(NOT (DEFINED MDBX_BUILD_CXX AND NOT MDBX_BUILD_CXX) |
134 | | - OR NOT (DEFINED MDBX_ENABLE_TESTS AND NOT MDBX_ENABLE_TESTS)) |
| 133 | + if(NOT (DEFINED MDBX_BUILD_CXX AND NOT MDBX_BUILD_CXX) OR NOT (DEFINED MDBX_ENABLE_TESTS AND NOT MDBX_ENABLE_TESTS)) |
135 | 134 | check_language(CXX) |
136 | 135 | if(CMAKE_CXX_COMPILER) |
137 | 136 | enable_language(CXX) |
@@ -348,7 +347,8 @@ if(NOT DEFINED MDBX_CXX_STANDARD) |
348 | 347 | elseif(CXX_FALLBACK_GNU11 OR CXX_FALLBACK_11) |
349 | 348 | set(MDBX_CXX_STANDARD 11) |
350 | 349 | else() |
351 | | - message(NOTICE "The C++ example will be skipped, since C++20 standard is unavailable or C++ API of libmdbx was disabled.") |
| 350 | + message(NOTICE |
| 351 | + "The C++ example will be skipped, since C++20 standard is unavailable or C++ API of libmdbx was disabled.") |
352 | 352 | set(MDBX_CXX_STANDARD 0) |
353 | 353 | endif() |
354 | 354 | endif() |
@@ -381,10 +381,6 @@ if(NOT DEFINED MDBX_C_STANDARD) |
381 | 381 | endif() |
382 | 382 | endif() |
383 | 383 |
|
384 | | -if((MINGW OR MINGW64) AND MDBX_BUILD_SHARED_LIBRARY) |
385 | | - message(WARNING "Most MinGW versions have various problems with exporting and/or importing C++ template symbols instantiated in a DLL.") |
386 | | -endif() |
387 | | - |
388 | 384 | if(WIN32 AND EXISTS "${MDBX_SOURCE_DIR}/ntdll.def") |
389 | 385 | if(MSVC) |
390 | 386 | if(NOT MSVC_LIB_EXE) |
@@ -524,8 +520,7 @@ else() |
524 | 520 | endif() |
525 | 521 |
|
526 | 522 | set(MDBX_CXX_AVAILABLE FALSE) |
527 | | -if(CMAKE_CXX_COMPILER_LOADED |
528 | | - AND NOT MDBX_CXX_STANDARD LESS 11) |
| 523 | +if(CMAKE_CXX_COMPILER_LOADED AND NOT MDBX_CXX_STANDARD LESS 11) |
529 | 524 | if(NOT MDBX_WITHOUT_MSVC_CRT |
530 | 525 | AND NOT (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) |
531 | 526 | AND NOT (CMAKE_COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.9) |
@@ -577,7 +572,10 @@ else() |
577 | 572 | if(NOT CMAKE_CURRENT_LIST_FILE) |
578 | 573 | set(CMAKE_CURRENT_LIST_FILE "CMakeLists.txt") |
579 | 574 | endif() |
580 | | - message(FATAL_ERROR "This \"${CMAKE_CURRENT_LIST_FILE}\" has been trimmed and is therefore intended only for build from an amalgamated form of the source code.") |
| 575 | + message( |
| 576 | + FATAL_ERROR |
| 577 | + "This \"${CMAKE_CURRENT_LIST_FILE}\" has been trimmed and is therefore intended only for build from an amalgamated form of the source code." |
| 578 | + ) |
581 | 579 | endif(MDBX_AMALGAMATED_SOURCE) |
582 | 580 |
|
583 | 581 | if(MDBX_BUILD_CXX) |
@@ -674,6 +672,12 @@ target_include_directories(mdbx-static INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}") |
674 | 672 |
|
675 | 673 | # build shared library |
676 | 674 | if(MDBX_BUILD_SHARED_LIBRARY) |
| 675 | + if((MINGW OR MINGW64) AND MDBX_BUILD_CXX) |
| 676 | + message( |
| 677 | + WARNING |
| 678 | + "Most MinGW versions have various problems with exporting and/or importing C++ template symbols instantiated in a DLL." |
| 679 | + ) |
| 680 | + endif() |
677 | 681 | add_library(mdbx SHARED ${LIBMDBX_SOURCES}) |
678 | 682 | set_target_properties(mdbx PROPERTIES PUBLIC_HEADER "${LIBMDBX_PUBLIC_HEADERS}") |
679 | 683 | target_compile_definitions( |
|
0 commit comments