Skip to content

Commit

Permalink
[SCons] Allow compiler options which contain commas
Browse files Browse the repository at this point in the history
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
  • Loading branch information
speth committed Mar 28, 2016
1 parent 92ccda8 commit 2e56f6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 3 additions & 3 deletions site_scons/buildutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2e56f6d

Please sign in to comment.