hoytech / lmdbxx

C++17 wrapper for the LMDB embedded B+ tree database library
The Unlicense
58 stars 16 forks source link

Add meson build system support #8

Closed deepbluev7 closed 1 year ago

deepbluev7 commented 2 years ago

This enables you to build the project using:

meson configure -Dexamples=true -Dtests=true builddir
meson compile -C builddir

You can run the tests using:

meson test -C builddir

And you can simply consume this project as a wrap in other meson projects.

This also adds a pkgconfig file, so you can do dependency('lmdb++', version: '>=1.0.0') in meson (or equivalent in other projects).

(It's useful for our usage in Nheko although we can just apply it as a patch in our wrap, so if you are against adding a buildsystem, that is fine by me. I just thought I should share it!)

hoytech commented 2 years ago

Thank you! I'm not against build-systems in general, and appreciate you sharing.

Can we maybe make a directory and put build-system related stuff in there, so the root directory doesn't get crowded as everyone adds their own build system stuff? Maybe build-systems/meson/ ?

deepbluev7 commented 2 years ago

From what I know, meson really doesn't like it, if the meson.build isn't in the projects root. Stuff like wraps need the meson.build in the root directory, because there is no way to specify the meson.build location. See this issue for example: https://github.com/mesonbuild/meson/issues/8015

An alternative would be to not put the meson.build into this repo but instead put it in the wrapdb or apply it as a wrap patch of course, but that is a bit less discoverable.

hoytech commented 1 year ago

Sorry, I should've just merged this, who cares about a couple extra files in the root dir? :)

Merging now. Let me know if it doesn't work for you.

deepbluev7 commented 1 year ago

Oh, wow, thank you! <3