-
Notifications
You must be signed in to change notification settings - Fork 75
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.build #36
Add meson.build #36
Conversation
I'm a bit apprehensive about adding this without a CI test since I'm not very comfortable with Meson. Would it be possible to add a Travis configuration for this which just builds the example or something? |
That is fair. I have updated the PR to include a .travis.yml change, and added some usage to the README. If you don't think they're adequate or think there could be any further changes than I'd be happy. (also I'm not entirely sure if the travis config will work, I don't really work with travis much). |
@nemequ any idea why the CI isn't queued up? |
Ugh, it's travis-ci/travis-ci#6632 again. I guess that's not going to be fixed any time soon, and this is a small repo, so I just pushed a change to resolve this. If you rebase your changes on top of master it should work now. Sorry about that.
It's a bit awkward since you're building it twice, but if you can get that working I can push another patch which will just add a single meson build. Something like (untested): diff --git a/.travis.yml b/.travis.yml
index a8f1487..b986983 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -131,13 +131,19 @@ matrix:
###
- os: osx
+ ###
+ ## Meson
+ ###
+ - env: BUILD_SYSTEM=meson
+
before_install:
- if [ -n "${C_COMPILER}" ]; then export CC="${C_COMPILER}"; fi
- if [ "${C_COMPILER}" = "pgcc" ]; then wget -q -O /dev/stdout 'https://raw.githubusercontent.com/nemequ/pgi-travis/master/install-pgi.sh' | /bin/sh; fi
+- if [ "${BUILD_SYSTEM}" = "meson" ]; then pip3 install meson; fi
script:
- - make CC="${CC}" AGGRESSIVE_WARNINGS=y EXTENSION="${EXTENSION}" OPENMP="${OPENMP}" ASAN="${ASAN}" UBSAN="${UBSAN}"
- - make test
+ - if [ "${BUILD_SYSTEM}" = "meson" ]; then meson build && ninja -Cbuild; else make CC="${CC}" AGGRESSIVE_WARNINGS=y EXTENSION="${EXTENSION}" OPENMP="${OPENMP}" ASAN="${ASAN}" UBSAN="${UBSAN}"; fi
+ - if [ "${BUILD_SYSTEM}" = "meson" ]; then ninja -Cbuild test; else make test; fi
notifications:
email: false |
IIRC that "pip3: command not found" error can be fixed by adding something like |
The meson.build file allows you to create a pkg-config and munit library when compiled directly, and include munit as a subproject from external meson projects using subproject() capabilities.
Looks like it fails on |
PGI C Compiler. I guess Meson doesn't support it. Anyways, I think I can finish it from here; I'll take a look tonight. |
I ran into the pip3 issue as well, I think I worked around it here by including the apt packages python3 and python3-pip. The Python 3 install on Travis seemed broken. |
@jibsen |
Merged into master, thanks!
Yeah, Travis seems really fragile when you need to mix languages :( |
This meson.build file allows you to create a pkg-config and munit library when compiled directly, and include munit as a subproject from external meson projects using subproject() capabilities. See https://github.com/eintw1ck/cha2slide/blob/master/src/meson.build#L75 for an example of how it's used (look for pkg-config version, then vendor if not found by pkg-config). Obviously for munit installing it as a library doesn't make much sense but being able to just set the url to this git repo is very useful (can only be done if the project has a meson.build).