Skip to content

Conversation

@clauderobi
Copy link

  • support to optionally create a static library
  • allow the binary to use the non system library (libjose.so) when buildng a debug version

- support to optionally create a static library
- allow the binary to use the non system library (libjose.so) when buildng a debug version
@clauderobi
Copy link
Author

clauderobi commented Feb 16, 2024

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
Copy link
Contributor

hdholm commented Feb 17, 2024

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
Copy link
Author

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:

  • IIUC the build as they are produces a debugoptimized variant, is it really the intent?
  • should there be an option to generate or not the executable. In such case the dynamic lib would be enabled implicitly

@hdholm
Copy link
Contributor

hdholm commented Feb 17, 2024

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

control if the executable is built. The default is true.

When build_execute is true, then build_dynmaic is forced true as
well since, ATM, the executable is built with dynamic linkage.
Consequently, to only build a static library, you need both
build_dynamic and build_executable set to false.
@clauderobi
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants