Transition to meson build system#11
Draft
pierre-labastie wants to merge 6 commits into
Draft
Conversation
Initial commit. Should work for build and install, but not yet for tests
eli-schwartz
suggested changes
Feb 16, 2025
| install_data(blocaled_conf, install_dir: sysconfdir) | ||
|
|
||
| serv_cfg=configuration_data() | ||
| serv_cfg.set('libexecdir', prefix + '/' + get_option('libexecdir')) |
There was a problem hiding this comment.
Suggested change
| serv_cfg.set('libexecdir', prefix + '/' + get_option('libexecdir')) | |
| serv_cfg.set('libexecdir', prefix / get_option('libexecdir')) |
The a / b operator is syntactic sugar for join_paths(a, b), it guarantees "smart" path joining regardless of edge cases such as "libexecdir lies outside of prefix so it ends up being an absolute path" (may be relevant on NixOS??) and is also just more readable if you ask me. :)
Collaborator
Author
There was a problem hiding this comment.
Thanks a lot for your kind review. I am not an expert in meson/python, and I'm learning while doing this. Will apply.
Apply the changes proposed by eli-schwartz: replace "+'/'+" with just " / " in path constructions. remove a test that is done by the gnome module
Collaborator
Author
|
Completed the transition in tests at 185b0cb. There may be things to add for |
We use errno, but define it nowhere. We could include <errno.h>, but this is done automatically starting with glib-2.61 (glib.h includes gtestutils.h, which includes errno.h). So bump minimal version to 2.61. This is almost 6 years old, so not a big requirement, I think.
For tests, we recompile ùain.c with different config.h. The source is in src, so we had "meson.project_source_root() / 'src/main.c'" as the source. It is better to use the files function to obtain a "file" object that can be used in any directory, letting meson do the work of defining paths to it.
We now use errno without including <errno.h>. This is possible because glib.h includes gtestutils.h, which includes errno.h. But this was added in glib-2.61. So we should have this version as minimal. We could of course include errno.h ourselves, but we do not have ways to test older versions of glib anyway. And glib-2.61 is almost five years old, so I don't think it is a big requirement.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial commit. Should work for build and install, but not yet for tests