diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2019-06-25 20:55:36 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2019-08-14 17:59:16 +0530 |
commit | 6c94493608292a5b839debf771e7243eb18654f8 (patch) | |
tree | f1a284a32af5520f271c7dde201e40220194d23c | |
parent | c43e29c71b25d2b5d93aa12a3aab38771cb71937 (diff) |
Don't allow people to run meson inside the uninstalled env
People should not run `meson` on gst-build inside the uninstalled env.
It will cause problems because meson will detect the already-built
libraries and pkg-config files.
This is not obvious to people, and they often make this mistake.
-rw-r--r-- | meson.build | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 3e13d12..95ba32a 100644 --- a/meson.build +++ b/meson.build @@ -11,6 +11,20 @@ glib_req = '>= 2.40.0' build_system = build_machine.system() cc = meson.get_compiler('c') +python3 = import('python').find_installation() +# Ensure that we're not being run from inside the gst-uninstalled env +# because that will confuse meson, and it might find the already-built +# gstreamer. It's fine if people run `ninja` as long as it doesn't run +# reconfigure because ninja doesn't care about the env. +ensure_not_uninstalled = ''' +import os +assert('GST_ENV' not in os.environ) +''' +cmdres = run_command(python3, '-c', ensure_not_uninstalled) +if cmdres.returncode() != 0 + error('Do not run `ninja` or `meson` for gst-build inside the uninstalled environment, you will run into problems') +endif + # Make it possible to use msys2 built zlib which fails # when not using the mingw toolchain as it uses unistd.h if not meson.is_subproject() and cc.get_id() == 'msvc' @@ -50,7 +64,6 @@ subprojects = [ ['gst-python', { 'option': get_option('python') }], ] -python3 = import('python').find_installation() symlink = ''' import os |