detect_c_compiler(): use shlex.split() instead of str.split() for env

Use shlex.split() for splitting the env var instead of str.split() to
handle quoting and spaces in paths.
pull/1396/head
Fabio Porcedda 8 years ago
parent 7144b03fd4
commit aa7f496144
  1. 3
      mesonbuild/environment.py

@ -19,6 +19,7 @@ from . import mlog
from .compilers import * from .compilers import *
from .mesonlib import EnvironmentException, Popen_safe from .mesonlib import EnvironmentException, Popen_safe
import configparser import configparser
import shlex
import shutil import shutil
build_filename = 'meson.build' build_filename = 'meson.build'
@ -356,7 +357,7 @@ class Environment:
else: else:
exe_wrap = [] exe_wrap = []
elif evar in os.environ: elif evar in os.environ:
compilers = os.environ[evar].split() compilers = shlex.split(os.environ[evar])
ccache = [] ccache = []
is_cross = False is_cross = False
exe_wrap = None exe_wrap = None

Loading…
Cancel
Save