Skip to content

Meson updates#546

Closed
optorres wants to merge 2 commits intoThrowTheSwitch:masterfrom
optorres:meson-update
Closed

Meson updates#546
optorres wants to merge 2 commits intoThrowTheSwitch:masterfrom
optorres:meson-update

Conversation

@optorres
Copy link

This updates the meson build scripts to bring them more-or-less up to parity with the CMake script and adds a meson build script to one of the project examples.

Build script additions:

  • Library version is now retrieved from unity.h instead of being left as undefined.
  • Extensions (fixture and memory) are now supported.
  • The library, headers, and package configuration files (using pkg-config instead of CMake's config format) are now installed with ninja install / meson compile install.

The following features from the CMake build have been implemented:
 * Library version retrieved from unity.h.
 * Extension support.
 * Library, header, and package configuration file installation.
@pmembrey
Copy link
Contributor

pmembrey commented Apr 5, 2021

Saw your PR after I submitted mine (#551) and as you clearly know far more about Meson than I do, would you be interested in integrating / improving my change as part of yours? :)

@mvandervoord
Copy link
Member

Not being a meson user myself, I'm not the person to resolve the conflicts between this commit and previous commits. If anyone wants to see this get merged, I'd urge you to take a look... otherwise this is eventually going to get closed from lack of interest.

@amcnulty-fermat
Copy link
Contributor

Not being a meson user myself, I'm not the person to resolve the conflicts between this commit and previous commits. If anyone wants to see this get merged, I'd urge you to take a look... otherwise this is eventually going to get closed from lack of interest.

Hello @mvandervoord , I would like to get this functionality into Unity as it would be very useful for me. I am going to try to put together a new PR for it based on this (already excellent) work done by @optorres . If this is not the right workflow, then please let me know.

@mvandervoord
Copy link
Member

@amcnulty-fermat -- That sounds perfect. Thank you for picking this up. I know there are numerous people who would appreciate this feature!

@amcnulty-fermat amcnulty-fermat mentioned this pull request Feb 13, 2023
meson_version: '>=0.53.0',
default_options: ['werror=true', 'c_std=c11']
version: run_command(
find_program('python'), 'auto' / 'extract_version.py', 'src/unity.h',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to find python here, because the extract_version.py script is runnable on its own as a regular program (it's executable and has a shebang). On Windows, Meson will scan the shebang and detect that it needs to be run with python.

Comment on lines +10 to +11
build_fixture = get_option('extension_fixture').enabled()
build_memory = get_option('extension_memory').enabled()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're just using these like booleans, it seems misleading to allow people to specify either =auto or =disabled and have auto really just mean disabled.

What about defining the options as type boolean, and just checking the option value directly?

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.

5 participants

Comments