diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-13 22:53:51 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-13 22:53:51 +0000 |
commit | 823b63ec4135ed33a1bd358d05e863dbf821a3b1 (patch) | |
tree | 6918b786dab0c6825a441575e81affe201686f39 /build | |
parent | d50dacfa212414132ab7db970b8b43cfeadb9cbe (diff) | |
download | chromium_src-823b63ec4135ed33a1bd358d05e863dbf821a3b1.zip chromium_src-823b63ec4135ed33a1bd358d05e863dbf821a3b1.tar.gz chromium_src-823b63ec4135ed33a1bd358d05e863dbf821a3b1.tar.bz2 |
Add a helper method to SConscript.main for adding .pdb files to the
output target of .exe files on Windows. Change all the callers to
only pass in the basename of the target (e.g., 'base_unittests').
The only exception is chrome.exe which uses chrome_exe.pdb.
This lets us remove a "if env['PLATFORM'] == 'win32'" condition from
base/SConscript and these other files going forward.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@836 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r-- | build/SConscript.main | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/build/SConscript.main b/build/SConscript.main index a13762e..ac22314 100644 --- a/build/SConscript.main +++ b/build/SConscript.main @@ -103,11 +103,34 @@ env = Environment( LIBPATH = ['$LIBS_DIR'], ) +def AddPdbToTarget(args): + """Add the windows pdb file to the build target. + + Arguments: + args is a tuple passed to ChromeProgram or ChromeTestProgram + Returns: + A tuple to pass on to Environment.Program.""" + # Only add .pdb to the target if the target was only a string. We can't + # blindly add foo.pdb because chrome.exe and chrome.dll use chrome_exe.pdb + # and chrome_dll.pdb. + if not isinstance(args[0], str): + return args + + mutable_args = list(args) + mutable_args[0] = [args[0], args[0] + '.pdb'] + return tuple(mutable_args) + def ChromeProgram(env, *args, **kw): + if env['PLATFORM'] == 'win32': + # TODO(tc): We should handle kw['target'] too. + args = AddPdbToTarget(args) return env.Program(*args, **kw) env.AddMethod(ChromeProgram, "ChromeProgram") def ChromeTestProgram(env, *args, **kw): + if env['PLATFORM'] == 'win32': + # TODO(tc): We should handle kw['target'] too. + args = AddPdbToTarget(args) return env.Program(*args, **kw) env.AddMethod(ChromeTestProgram, "ChromeTestProgram") |