[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#8483) CMake buildsystem support for LMDB



intelfx@intelfx.name wrote:
> Full_Name: Ivan Shapovalov
> Version: LMDB 0.9.18
> OS: GNU/Linux
> URL: ftp://ftp.openldap.org/incoming/ivan-shapovalov-160820.patch
> Submission from: (NULL) (77.41.63.43)
>
>
> This patch adds a CMake buildsystem for LMDB, side-by-side with existing
> Makefile.
> It builds the same targets except coverage tests.

I am not a fan of CMake. Using it requires learning a whole new set of 
documentation in addition to knowing the rules of Make. It comes with a huge 
footprint of dependencies, and most people using it are misusing it.

> Rationale for this change: CMake simplifies building of LMDB with non-standard
> toolchains
> such as Android NDK which only support their custom buildsystem and CMake (via
> a
> provided CMake toolchain configuration file).

Building for Android is trivial using e.g. agcc
https://gist.github.com/angad/1033321

> This way, one does not need to extract required compiler flags manually.
> Moreover, this simplifies life for projects which use CMake and LMDB, because a
> proper CMake buildsystem allows to e. g. automatically pass transitive
> dependencies like pthreads to dependent projects.

Using agcc allows one to build for Android any project that simply uses Make, 
which was 100% of them before CMake came along.

Transitive dependencies like pthreads, which you have now embedded into your 
CMakeLists.txt file, are actually compiler and platform dependent. That's why 
the LMDB Makefile sets it in an overridable macro, that a programmer can 
easily change on the commandline when invoking make on their chosen build 
platform.

Rejecting this patch and all future patches involving CMake. We will not use 
this tool ourselves and we will not maintain files that it uses in the LMDB 
source tree.

If you need to integrate LMDB into a particular CMake-based project, it's a 
lot simpler than this. E.g.,
https://github.com/LMDB/bitmonero/blob/master/external/db_drivers/liblmdb/CMakeLists.txt

There's no reason to duplicate the entire Makefile when you're embedding LMDB 
into some other project. This also shows the correct way to use CMake and 
propagate threads dependencies.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/