zserge / jsmn

Jsmn is a world fastest JSON parser/tokenizer. This is the official repo replacing the old one at Bitbucket
MIT License
3.65k stars 778 forks source link

Meson support for JSMN. #160

Closed squidfarts closed 4 years ago

squidfarts commented 5 years ago

Hello 😀.

I would like to provide support for Meson build system for the JSMN library. If you're interested check out their site and documentation.

Meson also has a dependency tool that downloads dependencies from third party venders like you. Developers using Meson would probably like to use a "[wrap-git]" file.

pt300 commented 5 years ago

It sounds really interesting although I don't feel like this change should depends on just me and I'd rather hear what @zserge has to say about it.

squidfarts commented 5 years ago

No rush. I simply provided the links so everyone can get a good look at Mesons features.

squidfarts commented 5 years ago

Where is @zserge anyway? Just wondering.

zserge commented 5 years ago

Like many other tiny libraries, JSMN is a single-header lib, independent of any build systems at all. I realize that Meson is a very promising one (and I can easily imagine people migrating from CMake to Meson). If Meson was the de-facto standard in the C/C++ world as of now - I would be all for this PR. However, it adds four files to let people use one file, and yet, I don't see how to switch low-memory mode or strict mode here.

With this is mind, I have two questions (since I have no practical experience with Meson myself yet):

1) Will this PR help people to use JSMN if they use Meson builds in their own projects? Easier to specify it as a dependency? Easier to upgrade versions? Easier to toggle build options, etc? 2) If this PR replaces Makefile for JSMN itself - how will it make like easier for JSMN contributors? I'm asking because with Makefiles I personally see no problems, they just work on Linux and Mac, can be used for cross-compilation on embedded platforms and so on.

But nevertheless, thanks for the PR, and you really sparkled my interest towards Meson.

squidfarts commented 5 years ago

For your header only library it would acutely take one simple little Meson build script just to export the header to other Meson projects. The other 'meson.build' scripts where put in so that if I found a bug I can fix it and run the test to make sure I did not brake JSMN library also I have a need for a small light Json library, I can remove the extra 'meson.build' sub scripts if that would help.

Answer to question one, yes it would help other people use JMSN in there own Meson projects, all they need todo is write a simple git wrap file and get the declared dependency variable 'jsmn_dep'.

Now for the last question, contributors using Makefiles. Will I can give a link to porting from autotools. Meson projects can work one Mac, Linux like systems and Windows.