From 01eb252f6782fa63dc657180aee31cd89bf13134 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 25 Jun 2019 20:55:36 +0530 Subject: [PATCH] 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. --- meson.build | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 22551d2..a599806 100644 --- a/meson.build +++ b/meson.build @@ -11,6 +11,20 @@ glib_req = '>= 2.44.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 + documented_projects = '' # Make it possible to use msys2 built zlib which fails # when not using the mingw toolchain as it uses unistd.h @@ -51,7 +65,6 @@ subprojects = [ ['gst-python', { 'option': get_option('python'), 'has-plugins': true}], ] -python3 = import('python').find_installation() symlink = ''' import os -- 2.7.4