From 823b63ec4135ed33a1bd358d05e863dbf821a3b1 Mon Sep 17 00:00:00 2001 From: "tc@google.com" Date: Wed, 13 Aug 2008 22:53:51 +0000 Subject: 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 --- build/SConscript.main | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'build') 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") -- cgit v1.1