Skip to content
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

Add Meson buildsystem support #424

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dcbaker
Copy link
Contributor

@dcbaker dcbaker commented Mar 14, 2024

Meson, Like CMake and Bazel, is a modern build system supporting C++ with the ability to configure and build dependencies from source. To do this effectively, it needs native Meson build definitions for the project to be built. This PR adds those definitions with as much parity to the C++ build system as possible, with the exception of the generation of the CMake configuration files (Meson cannot generate sophisticated ones using targets), and without some of the tests, since one is for CMake files it doesn't generate, and the other is for fuzzing, which is still a painful experience in Meson.

I've provided CI jobs, but much more minimal ones than what CMake runs.


This change is Reviewable

@jarro2783
Copy link
Owner

Thanks, I know nothing about Meson so if it builds then it looks good to me. I just don't see the main unit tests being built and run.

This is primarily intended to be useful for projects using Meson wishing
to consume cxxopts as a subproject. By hosting the files upstream users
get the benefit of automatic parity with the CMake based install
provided by an OS vendor or distribution.

The implementation attempts to mirror the CMake build as much as
possible, with the exception of generating the cmake-config files, which
Meson doesn't currently support. It uses a small python script to parse
the cxxopts.hpp header to extract the version, due to a concious design
decision of Meson to leave such complex logic to external scripting
languages like Python.
I've tried to be a bit more minimal here than the CMake tests are, since
there's already a good cross section of testing there. For Meson, I just
want to touch test each of the major platforms to ensure that it works
@dcbaker
Copy link
Contributor Author

dcbaker commented Mar 18, 2024

You're right! I'm not sure how I missed adding that. the latest version has that tested added.

@dcbaker dcbaker force-pushed the submit/meson branch 2 times, most recently from 966e1e7 to 8dd0b2e Compare March 18, 2024 17:40
@jarro2783
Copy link
Owner

Does this run the tests?

@jarro2783
Copy link
Owner

It looks like it builds the tests but doesn't run them. I think it would be good to run them as well.

@dcbaker
Copy link
Contributor Author

dcbaker commented Apr 13, 2024

Yeah, i think it should be running them, but it doesn't. I'm not sure if it's a GitHub configuration issue or something in the Meson. I haven't had time to look this week, but I'm hoping to on Monday

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.

None yet

2 participants