aboutsummaryrefslogtreecommitdiff
path: root/db_drivers/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'db_drivers/CMakeLists.txt')
-rw-r--r--db_drivers/CMakeLists.txt26
1 files changed, 9 insertions, 17 deletions
diff --git a/db_drivers/CMakeLists.txt b/db_drivers/CMakeLists.txt
index 5993ed3a2..db386c11f 100644
--- a/db_drivers/CMakeLists.txt
+++ b/db_drivers/CMakeLists.txt
@@ -26,24 +26,16 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-find_package(LMDB)
-
-if(NOT LMDB_LIBRARIES OR STATIC)
+# We aren't even going to check the system for an installed LMDB driver, as it is too
+# critical a consensus component to rely on dynamically linked libraries
+if(CMAKE_SIZEOF_VOID_P EQUAL "8")
+ message(STATUS "Using 64-bit LMDB from source tree")
add_subdirectory(liblmdb)
- message(STATUS "lmdb not found, building from src tree")
-
- set(LMDB_STATIC true PARENT_SCOPE)
set(LMDB_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/liblmdb" PARENT_SCOPE)
- set(LMDB_LIBRARY "lmdb" PARENT_SCOPE)
else()
- message(STATUS "Found liblmdb include (lmdb.h) in ${LMDB_INCLUDE_DIR}")
- if(LMDB_LIBRARIES)
- message(STATUS "Found liblmdb shared library")
- set(LMDB_STATIC false PARENT_SCOPE)
- set(LMDB_INCLUDE ${LMDB_INCLUDE_DIR} PARENT_SCOPE)
- set(LMDB_LIBRARY ${LMDB_LIBRARIES} PARENT_SCOPE)
- set(LMDB_LIBRARY_DIRS "" PARENT_SCOPE)
- else()
- die("Found liblmdb includes, but could not find liblmdb library. Please make sure you have installed liblmdb or liblmdb-dev or the equivalent")
- endif()
+ message(STATUS "Using 32-bit LMDB from source tree")
+ add_subdirectory(liblmdb-vl32)
+ set(LMDB_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/liblmdb-vl32" PARENT_SCOPE)
endif()
+
+set(LMDB_LIBRARY "lmdb" PARENT_SCOPE)