diff options
author | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-14 22:53:00 +0000 |
---|---|---|
committer | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-14 22:53:00 +0000 |
commit | eddf4cac5afd0e56f3a50ae854eaf334285ea98e (patch) | |
tree | 8d8d591ec49ea76867a8ffe1db8856dc7446371e /build/SConscript.main | |
parent | 5e0f30c03417379891c4e0df39d935e4fbdb40ec (diff) | |
download | chromium_src-eddf4cac5afd0e56f3a50ae854eaf334285ea98e.zip chromium_src-eddf4cac5afd0e56f3a50ae854eaf334285ea98e.tar.gz chromium_src-eddf4cac5afd0e56f3a50ae854eaf334285ea98e.tar.bz2 |
Call an external command on Windows (xcopy) to install .lib files into
our library directory.
This works around some weird Windows? Python? SCons? threading race
condition where a file copied by Python code in one thread sometimes
prevents it from being opened by an external command spawned in another
thread (specifically the linker, leading an 1104 error), despite the
fact that the copy has concluded.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@905 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/SConscript.main')
-rw-r--r-- | build/SConscript.main | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/build/SConscript.main b/build/SConscript.main index 26649f3..d687f67 100644 --- a/build/SConscript.main +++ b/build/SConscript.main @@ -136,7 +136,20 @@ env.AddMethod(ChromeTestProgram, "ChromeTestProgram") def ChromeStaticLibrary(env, *args, **kw): result = env.StaticLibrary(*args, **kw) - env.Install('$LIBS_DIR', result) + if env['PLATFORM'] == 'win32': + # TODO(sgk): + # We'd like to do this with env.Install() like we do on other systems, + # but this causes problems on Windows when the Python copy of the file + # in one thread prevents a linker spawned by another thread from + # opening the copied .lib, despite the fact that the copy has + # successfully concluded before the spawn occurs. Work around the + # underlying problem (whatever it is) by calling the external Windows + # xcopy utility. + env.Command('$LIBS_DIR/${RESULT.name}', '$RESULT', + "xcopy /q /y $SOURCE ${TARGET.dir}", + RESULT=result[0]) + else: + env.Install('$LIBS_DIR', result) return result env.AddMethod(ChromeStaticLibrary, "ChromeStaticLibrary") @@ -291,6 +304,8 @@ if env['PLATFORM'] == 'win32': env['ENV']['SystemDrive'] = os.environ['SystemDrive'] env['ENV']['USERPROFILE'] = os.environ['USERPROFILE'] + env.AppendENVPath('PATH', ';C:\\WINDOWS\\system32') + elif env['PLATFORM'] == 'posix': # Copy some environment variables from the outer environment if they exist. |