Skip to content

Commit 4144ac3

Browse files
author
sgjesse@gmail.com
committed
Refactored the evn override handling to a single method and fixed the handling
of the case where ENV is not a dictionary which could happen when the environment variable ENV was set when invoking SCons. Fixed building dynamic library on Windows in the case where env overrides was specified as before these was not passed to the linking of the DLL. There is still a SCons issue when the environment variable ENV is set when invoking SCons, however this looks like a SCons issue. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@156 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
1 parent bdb91eb commit 4144ac3

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

SConstruct

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import re
3030
import sys
3131
import os
3232
from os.path import join, dirname, abspath
33+
from types import DictType
3334
root_dir = dirname(File('SConstruct').rfile().abspath)
3435
sys.path.append(join(root_dir, 'tools'))
3536
import js2c, utils
@@ -370,6 +371,14 @@ class BuildContext(object):
370371
else:
371372
return env.SharedObject(input, **kw)
372373

374+
def ApplyEnvOverrides(self, env):
375+
if not self.env_overrides:
376+
return
377+
if type(env['ENV']) == DictType:
378+
env['ENV'].update(**self.env_overrides)
379+
else:
380+
env['ENV'] = self.env_overrides
381+
373382

374383
def PostprocessOptions(options):
375384
# Adjust architecture if the simulator option has been set
@@ -428,6 +437,7 @@ def BuildSpecific(env, mode, env_overrides):
428437
)
429438

430439
# Link the object files into a library.
440+
context.ApplyEnvOverrides(env)
431441
if context.options['library'] == 'static':
432442
library = env.StaticLibrary(library_name, object_files)
433443
else:

src/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def Abort(message):
9797
def ConfigureObjectFiles():
9898
env = Environment()
9999
env.Replace(**context.flags['v8'])
100-
env['ENV'].update(**context.env_overrides)
100+
context.ApplyEnvOverrides(env)
101101
env['BUILDERS']['JS2C'] = Builder(action=js2c.JS2C)
102102
env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET --logfile $LOGFILE')
103103

test/cctest/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def Build():
5353
cctest_files = context.GetRelevantSources(SOURCES)
5454
env = Environment()
5555
env.Replace(**context.flags['cctest'])
56-
env['ENV'].update(**context.env_overrides)
56+
context.ApplyEnvOverrides(env)
5757
# There seems to be a glitch in the way scons decides where to put
5858
# PDB files when compiling using MSVC so we specify it manually.
5959
# This should not affect any other platforms.

0 commit comments

Comments
 (0)