kgabis / parson

Lightweight JSON library written in C.
MIT License
1.35k stars 329 forks source link

Build using meson #179

Closed uni-dos closed 2 years ago

uni-dos commented 2 years ago

Meson is much easier to read and write compared to Cmake and Make. I added Meson to parson here. Meson support allows parson to be integrated as a subproject if parson is not installed on the system.

kgabis commented 2 years ago

Hi, it's the first time I'm hearing about meson. I'm not a big fan of cmake so I'll try to find more about it and decide whether to add it or not (the only downside being one extra file). Ping me if I don't respond in a reasonable time (few weeks).

uni-dos commented 2 years ago

@kgabis Any update on this? I have an implementation here that I can merge. I could also implement the tests to remove cmake and make all together, but I think those should stay to avoid issues with third party projects using parson them.

kgabis commented 2 years ago

Hi, could you update "meson.build" so it matches the current version (1.4.0) and make a PR?

uni-dos commented 2 years ago

Oh my bad. I just did. I hope the pull request looks good.

kgabis commented 2 years ago

I've added meson.build in https://github.com/kgabis/parson/commit/d259c9b3f90d4c75664169d9565798ef6c5b95e9. Sorry for doing this outside the PR but it was faster this way (I've also added a soversion comment). Thanks for your work!

uni-dos commented 2 years ago

Yeah sorry about that. I would have added unnecessary commits to the project. I should have just deleted the pull request and submit a different one. Regarding the so version, does parson offer abi compatibility? I only added the soversion because other projects included it as well.

eli-schwartz commented 2 years ago

You don't need to delete and submit a new pull request. :) Git has a native tool for this.

To fix old commits, you can use git rebase -i origin/master and change all but the first commit to "fixup", and it will merge the commits together so that it is as if you had originally used git commit --amend instead of creating a new commit.

kgabis commented 2 years ago

Regarding the so version, does parson offer abi compatibility?

I don't expose any structs directly so there should be ABI compatibility between different versions.

uni-dos commented 2 years ago

If that's the case, maybe there isn't a need for the so version.

uni-dos commented 2 years ago

@eli-schwartz Hm, I was doing that and using git revert. Maybe that was my issue.

kgabis commented 2 years ago

Don't worry too much about having too many commits, I can squash them during merge.

uni-dos commented 2 years ago

I thought you couldn't because it was on my branch. But at least I'm beginning to learn git properly and contributing to open source software.

eli-schwartz commented 2 years ago

@eli-schwartz Hm, I was doing that and using git revert. Maybe that was my issue.

git revert creates a new commit. You can use git revert --no-commit to avoid creating a new commit, and only switch the source code back -- then after that you can manually git commit as a new commit (git will even remember the automatic commit message template for a reversion), or git commit --amend to edit the previous commit.