latchset / jose

C-language implementation of Javascript Object Signing and Encryption
Apache License 2.0
179 stars 49 forks source link

Modified the meson build declaration to #149

Open clauderobi opened 9 months ago

clauderobi commented 9 months ago
clauderobi commented 9 months ago

I am not 100% sure I did this correctly. Anyway ninja test ran successfully.

Also, the behavior of meson setup .. --prefix=/usr/local is slightly different since it appears that the default build type is debugoptimized (to my surprise) and I changed the behaviour for that type. If needed I suggest to change the default build type to release.

hdholm commented 9 months ago

I may be mistaken, but I think this doesn't correctly build a static library if the shared library isn't being built. Trying to run it with:

  meson setup .. --prefix=/usr/local
  meson configure -Dbuild_static=true -Dbuild_dynamic=false
  ninja

causes a failure in cmd/meson.build with ../cmd/meson.build:29:16: ERROR: Unknown variable "libjose_dep". Ideally, I think if this is accepted, .github/actions/build.yml should probably be extended to build both a shared and static library (separately) to ensure that both get adequately tested on changes.

clauderobi commented 9 months ago

Thanks for reporting.

My intent is to use the library as .... a library so I went too quick on actual executable generation. But before spending on fixing I have 2 questions:

hdholm commented 9 months ago

Hopefully someone else will answer. I'm just a contributor. I don't make decisions. :smile:

clauderobi commented 9 months ago

Ok, I added new commits to my master branch. According to the message above, I understand that the PR will include them. But I may be wrong... tell me.

I added an explicit option to build or not the executable. The default is true and will force build_dynamic to be true.