From 2e56f6dee39234a7539ee21c00bf3bd975bf6e97 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sun, 27 Mar 2016 20:19:25 -0400 Subject: [PATCH] [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 --- SConstruct | 3 ++- site_scons/buildutils.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index ad6e851db..3701146a9 100644 --- a/SConstruct +++ b/SConstruct @@ -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', diff --git a/site_scons/buildutils.py b/site_scons/buildutils.py index 843b1588d..353609461 100644 --- a/site_scons/buildutils.py +++ b/site_scons/buildutils.py @@ -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)