-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 support for building with Meson #2530
Conversation
Codecov Report
@@ Coverage Diff @@
## devel #2530 +/- ##
=======================================
Coverage 91.56% 91.56%
=======================================
Files 183 183
Lines 7558 7558
=======================================
Hits 6920 6920
Misses 638 638 |
These changes are being improved based on review comments in mesonbuild/wrapdb#643 . Once that review is complete I'll update this PR. |
Why should the build be part of this project, rather than just a recipe in wrapdb? |
I hoped that it would be more likely to stay up to date if it was included in Catch2 itself, just like the |
It's indeed more trusted (all content from the original project), easier to use (vs. patching in a secondary source), more likely to remain updated, and works better as a git submodule, or when updating to arbitrary commit checkpoints as the wrapdb will never add support for those. If, as implied by e.g. the bazel support, the Catch2 project is open to hosting integrations directly, that's the superior solution and the externally patched-in overlay can be dropped from the wrapdb (which may still host a metadata-only record). |
I have two issues with keeping Meson build support in-repo.
Neither of these are deal breakers, but they are not ideal. The positive side is that the configuration can be done sanely (unlike Bazel), and that there will be few CI jobs to keep the build functional. |
Speaking with my @mesonbuild core committer hat on, you are more than welcome to ping me and ask for help at any time. Duplicating file lists across build systems isn't particularly fun, but one possible option is to have a text file with one source filename per line, and read it into each build system. For meson this would be something like: fs = import('fs')
sources = files(
fs.read('srclist.txt').split()
) (Meson will automatically reconfigure if that file list changes, because it's treated as a build definition file.) |
Very well. |
02859c3
to
3875016
Compare
@mikecrowe Is this ready for review? |
I think so. Would you like me to squash it down to a single commit first? |
The Meson[1] build system makes it easier incorporate third-party libaries into a project if they also build using Meson. Let's add a minimal Meson build that's compatible with the CMake build, along with a GitHub workflow to check that it builds and that at least the simplest SelfTest runs. The handling of catch_user_config.hpp is inspired by BUILD.bazel and doesn't attempt to support any configuratons options. Such features could be added later. Meson strongly discourages using wildcards to specify sources, so the source and header lists are copied from CMakeLists.txt. Add a new test workflow to test the Meson builds. I was unable to get these tests to pass with Ubuntu 20.04, so they use Ubuntu 22.04. I'm neither a CMake nor a Meson expert, but the results seem to work for me. [1] https://mesonbuild.com/
Incorporate improvements suggested by Meson maintainer in mesonbuild/wrapdb#643 .
CMakeLists.txt calls the SelfTest binary SelfTest, so we should do so too.
3875016
to
d0b0cb1
Compare
The Meson[1] build system makes it easier incorporate third-party libaries into a project if they also build using Meson.
Let's add a minimal Meson build that's compatible with the CMake build, along with a GitHub workflow to check that it builds and that at least the simplest SelfTest runs.
The handling of catch_user_config.hpp is inspired by BUILD.bazel and doesn't attempt to support any configuratons options. Such features could be added later.
Meson strongly discourages using wildcards to specify sources, so the source and header lists are copied from CMakeLists.txt.
Add a new test workflow to test the Meson builds. I was unable to get these tests to pass with Ubuntu 20.04, so they use Ubuntu 22.04.
I'm neither a CMake nor a Meson expert, but the results seem to work for me.
[1] https://mesonbuild.com/
Description
GitHub Issues