diff --git a/SConstruct b/SConstruct index abd5e9022c..6bb23ce09d 100644 --- a/SConstruct +++ b/SConstruct @@ -450,6 +450,7 @@ def BuildSpecific(env, mode, env_overrides): for sample in context.samples: sample_env = Environment(LIBRARY=library_name) sample_env.Replace(**context.flags['sample']) + sample_env['ENV'].update(**context.env_overrides) sample_object = sample_env.SConscript( join('samples', 'SConscript'), build_dir=join('obj', 'sample', sample, target_id), diff --git a/test/cctest/SConscript b/test/cctest/SConscript index 2da4de62f2..cc59199148 100644 --- a/test/cctest/SConscript +++ b/test/cctest/SConscript @@ -53,6 +53,7 @@ def Build(): cctest_files = context.GetRelevantSources(SOURCES) env = Environment() env.Replace(**context.flags['cctest']) + env['ENV'].update(**context.env_overrides) # There seems to be a glitch in the way scons decides where to put # PDB files when compiling using MSVC so we specify it manually. # This should not affect any other platforms. diff --git a/tools/test.py b/tools/test.py index 5a7e331d1e..ef47a381bc 100755 --- a/tools/test.py +++ b/tools/test.py @@ -490,8 +490,10 @@ def RunTestCases(all_cases, progress): return progress.Run() -def BuildRequirements(context, requirements, mode): - command_line = ['scons', '-Y', context.workspace, 'mode=' + ",".join(mode)] + requirements +def BuildRequirements(context, requirements, mode, scons_flags): + command_line = (['scons', '-Y', context.workspace, 'mode=' + ",".join(mode)] + + requirements + + scons_flags) output = ExecuteNoCapture(command_line, context) return output.exit_code == 0 @@ -921,6 +923,8 @@ def BuildOptions(): default='release') result.add_option("-v", "--verbose", help="Verbose output", default=False, action="store_true") + result.add_option("-S", dest="scons_flags", help="Flag to pass through to scons", + default=[], action="append") result.add_option("-p", "--progress", help="The style of progress indicator (verbose, dots, color, mono)", choices=PROGRESS_INDICATORS.keys(), default="mono") @@ -1026,7 +1030,7 @@ def Main(): reqs += root.GetBuildRequirements(path, context) reqs = list(set(reqs)) if len(reqs) > 0: - if not BuildRequirements(context, reqs, options.mode): + if not BuildRequirements(context, reqs, options.mode, options.scons_flags): return 1 # Get status for tests