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.
This commit is contained in:
Nirbheek Chauhan 2019-06-25 20:55:36 +05:30
parent 9c4cb201d0
commit 01eb252f67

View file

@ -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