From b20fe49192425fab3e92aa444bd5e9bcc9837cc8 Mon Sep 17 00:00:00 2001 From: "sgk@google.com" Date: Wed, 1 Apr 2009 22:05:52 +0000 Subject: Change uses of the SCons Install() builder to 'cp' inside the Chromium infrastructure, too. Review URL: http://codereview.chromium.org/60030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12984 0039d316-1c4b-4281-b951-d872f2087c98 --- site_scons/site_tools/chromium_builders.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/site_scons/site_tools/chromium_builders.py b/site_scons/site_tools/chromium_builders.py index 56081ea..65dbb95 100644 --- a/site_scons/site_tools/chromium_builders.py +++ b/site_scons/site_tools/chromium_builders.py @@ -191,7 +191,7 @@ def ChromeProgram(env, target, source, *args, **kw): source = compilable_files(env, source) if env.get('_GYP'): prog = env.Program(target, source, *args, **kw) - result = env.Install('$TOP_BUILDDIR', prog) + result = env.ChromeInstall('$TOP_BUILDDIR', prog) else: result = env.ComponentProgram(target, source, *args, **kw) if env.get('INCREMENTAL'): @@ -202,7 +202,7 @@ def ChromeTestProgram(env, target, source, *args, **kw): source = compilable_files(env, source) if env.get('_GYP'): prog = env.Program(target, source, *args, **kw) - result = env.Install('$TOP_BUILDDIR', prog) + result = env.ChromeInstall('$TOP_BUILDDIR', prog) else: result = env.ComponentTestProgram(target, source, *args, **kw) if env.get('INCREMENTAL'): @@ -213,7 +213,7 @@ def ChromeLibrary(env, target, source, *args, **kw): source = compilable_files(env, source) if env.get('_GYP'): lib = env.Library(target, source, *args, **kw) - result = env.Install('$LIB_DIR', lib) + result = env.ChromeInstall('$LIB_DIR', lib) else: result = env.ComponentLibrary(target, source, *args, **kw) return result @@ -231,7 +231,7 @@ def ChromeStaticLibrary(env, target, source, *args, **kw): source = compilable_files(env, source) if env.get('_GYP'): lib = env.StaticLibrary(target, source, *args, **kw) - result = env.Install('$LIB_DIR', lib) + result = env.ChromeInstall('$LIB_DIR', lib) else: kw['COMPONENT_STATIC'] = True result = env.ComponentLibrary(target, source, *args, **kw) @@ -241,7 +241,7 @@ def ChromeSharedLibrary(env, target, source, *args, **kw): source = compilable_files(env, source) if env.get('_GYP'): lib = env.SharedLibrary(target, source, *args, **kw) - result = env.Install('$LIB_DIR', lib) + result = env.ChromeInstall('$LIB_DIR', lib) else: kw['COMPONENT_STATIC'] = False result = [env.ComponentLibrary(target, source, *args, **kw)[0]] @@ -293,6 +293,18 @@ def ChromeMSVSSolution(env, *args, **kw): Alias('msvs', i) return result +def ChromeInstall(env, target, source): + """ + Replacement for the stock SCons Install() builder to use the + external cp utility instead of Python internals. + """ + result = [] + copy_action = Action('cp $SOURCE $TARGET', 'Copying $TARGET') + for s in source: + dest = str(target) + '/' + os.path.split(str(s))[1] + result.extend(env.Command(dest, s, copy_action) + return result + def generate(env): env.AddMethod(ChromeProgram) env.AddMethod(ChromeTestProgram) @@ -304,6 +316,7 @@ def generate(env): env.AddMethod(ChromeMSVSFolder) env.AddMethod(ChromeMSVSProject) env.AddMethod(ChromeMSVSSolution) + env.AddMethod(ChromeInstall) env.AddMethod(FilterOut) -- cgit v1.1