diff --git a/SConstruct b/SConstruct index a45d23675e0..ffb76f42e2b 100644 --- a/SConstruct +++ b/SConstruct @@ -333,9 +333,19 @@ add_option('cache-dir', "Specify the directory to use for caching objects if --cache is in use", 1, False, default="$BUILD_ROOT/scons/cache") +variable_parse_mode_choices=['auto', 'posix', 'other'] +add_option('variable-parse-mode', + "Select which parsing mode is used to interpret command line variables", + 1, False, + type='choice', default=variable_parse_mode_choices[0], + choices=variable_parse_mode_choices) + # Setup the command-line variables def variable_shlex_converter(val): - return shlex.split(val) + parse_mode = get_option('variable-parse-mode') + if parse_mode == 'auto': + parse_mode = 'other' if windows else 'posix' + return shlex.split(val, posix=(parse_mode == 'posix')) def variable_arch_converter(val): arches = {