aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mconf.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2018-04-30 13:53:40 -0400
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-05-01 12:09:45 +0000
commit24f1b96dde9a0faf961a421f63212d5245de12c0 (patch)
treee993a0b465610fd56752e3442a0dc53508c80dc2 /mesonbuild/mconf.py
parent4f4cdee6876148b14a430e5886fec45299bb0573 (diff)
downloadmeson-24f1b96dde9a0faf961a421f63212d5245de12c0.zip
meson-24f1b96dde9a0faf961a421f63212d5245de12c0.tar.gz
meson-24f1b96dde9a0faf961a421f63212d5245de12c0.tar.bz2
Fix setting c_args and friends from command line
When passing more than one -Dc_args it should override the value instead of appending. This is how all other options works. Value should be split on spaces using shlex just like it does with CFLAGS environment variable. Fixes #3473.
Diffstat (limited to 'mesonbuild/mconf.py')
-rw-r--r--mesonbuild/mconf.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py
index 363b4a9..f65d6ff 100644
--- a/mesonbuild/mconf.py
+++ b/mesonbuild/mconf.py
@@ -15,6 +15,7 @@
import os
import sys
import argparse
+import shlex
from . import (coredata, mesonlib, build)
def buildparser():
@@ -119,14 +120,14 @@ class Conf:
raise ConfException('Unknown language %s in linkargs.' % lang)
# TODO, currently split on spaces, make it so that user
# can pass in an array string.
- newvalue = v.split()
+ newvalue = shlex.split(v)
self.coredata.external_link_args[lang] = newvalue
elif k.endswith('_args'):
lang = k[:-5]
if lang not in self.coredata.external_args:
raise ConfException('Unknown language %s in compile args' % lang)
# TODO same fix as above
- newvalue = v.split()
+ newvalue = shlex.split(v)
self.coredata.external_args[lang] = newvalue
else:
raise ConfException('Unknown option %s.' % k)