import sys
import os
from os.path import join, dirname, abspath
+from types import DictType
root_dir = dirname(File('SConstruct').rfile().abspath)
sys.path.append(join(root_dir, 'tools'))
import js2c, utils
else:
return env.SharedObject(input, **kw)
+ def ApplyEnvOverrides(self, env):
+ if not self.env_overrides:
+ return
+ if type(env['ENV']) == DictType:
+ env['ENV'].update(**self.env_overrides)
+ else:
+ env['ENV'] = self.env_overrides
+
def PostprocessOptions(options):
# Adjust architecture if the simulator option has been set
)
# Link the object files into a library.
+ context.ApplyEnvOverrides(env)
if context.options['library'] == 'static':
library = env.StaticLibrary(library_name, object_files)
else:
def ConfigureObjectFiles():
env = Environment()
env.Replace(**context.flags['v8'])
- env['ENV'].update(**context.env_overrides)
+ context.ApplyEnvOverrides(env)
env['BUILDERS']['JS2C'] = Builder(action=js2c.JS2C)
env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET --logfile $LOGFILE')
cctest_files = context.GetRelevantSources(SOURCES)
env = Environment()
env.Replace(**context.flags['cctest'])
- env['ENV'].update(**context.env_overrides)
+ context.ApplyEnvOverrides(env)
# 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.