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.build #36

Closed
wants to merge 1 commit into from
Closed

Add meson.build #36

wants to merge 1 commit into from

Conversation

jdek
Copy link
Contributor

@jdek jdek commented Mar 10, 2018

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).

@nemequ
Copy link
Owner

nemequ commented Mar 10, 2018

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?

@jdek
Copy link
Contributor Author

jdek commented Mar 10, 2018

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).

@jdek
Copy link
Contributor Author

jdek commented Mar 10, 2018

@nemequ any idea why the CI isn't queued up?

@nemequ
Copy link
Owner

nemequ commented Mar 10, 2018

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.

(also I'm not entirely sure if the travis config will work, I don't really work with travis much).

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

@nemequ
Copy link
Owner

nemequ commented Mar 10, 2018

IIRC that "pip3: command not found" error can be fixed by adding something like pyenv local 3.6 to the "before_install" section.

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.
@jdek
Copy link
Contributor Author

jdek commented Mar 11, 2018

Looks like it fails on pgcc. What exactly is pgcc?

@nemequ
Copy link
Owner

nemequ commented Mar 11, 2018

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.

@jibsen
Copy link
Collaborator

jibsen commented Mar 11, 2018

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.

@jdek
Copy link
Contributor Author

jdek commented Mar 11, 2018

@jibsen pyenv local 3.6 seems to have worked fine

@nemequ
Copy link
Owner

nemequ commented Mar 11, 2018

Merged into master, thanks!

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.

Yeah, Travis seems really fragile when you need to mix languages :(

@nemequ nemequ closed this Mar 11, 2018
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.

3 participants