meson: error out if qemu_suffix starts with /
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 11 Sep 2020 12:42:48 +0000 (14:42 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 30 Sep 2020 17:09:19 +0000 (19:09 +0200)
Since the variable is used for path concatenation, the result would
ignore the prefix directory altogether.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
meson.build

index 5b586afc389af6c4b29f2055839bae13b4a43095..9755be79fdd2b6acb3c5c46a85bb6458bd4226d1 100644 (file)
@@ -17,6 +17,11 @@ config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
 enable_modules = 'CONFIG_MODULES' in config_host
 enable_static = 'CONFIG_STATIC' in config_host
 build_docs = 'BUILD_DOCS' in config_host
+
+if get_option('qemu_suffix').startswith('/')
+  error('qemu_suffix cannot start with a /')
+endif
+
 qemu_datadir = get_option('datadir') / get_option('qemu_suffix')
 qemu_docdir = get_option('docdir') / get_option('qemu_suffix')
 config_host_data = configuration_data()