[SCons] Allow compiler options which contain commas

Compiler options such as '-Wl,-z,rlero' were incorrectly being split into
multiple options by SCons. Compiler options must now be separated by spaces when
specified on the SCons command line.

Fixes #320
This commit is contained in:
Ray Speth
2016-03-27 20:19:25 -04:00
parent 92ccda85fc
commit 2e56f6dee3
2 changed files with 5 additions and 4 deletions

View File

@@ -459,7 +459,8 @@ config_options = [
'LD_LIBRARY_PATH,HOME'.""",
defaults.env_vars),
('cxx_flags',
'Compiler flags passed to the C++ compiler only.',
"""Compiler flags passed to the C++ compiler only. Separate multiple
options with spaces, e.g. cxx_flags='-g -Wextra -O3 --std=c++11'""",
defaults.cxxFlags),
('cc_flags',
'Compiler flags passed to both the C and C++ compilers, regardless of optimization level',

View File

@@ -511,11 +511,11 @@ def formatOption(env, opt):
def listify(value):
"""
Convert an option specified as a string to a list. Allow both
comma and space as delimiters. Passes lists transparently.
Convert an option specified as a string to a list, using spaces as
delimiters. Passes lists transparently.
"""
if isinstance(value, types.StringTypes):
return value.replace(',', ' ').split()
return value.split()
else:
# Already a sequence. Return as a list
return list(value)