-
Notifications
You must be signed in to change notification settings - Fork 5
Transition to meson build system #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Initial commit. Should work for build and install, but not yet for tests
data/meson.build
Outdated
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
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.
Initial commit. Should work for build and install, but not yet for tests