msvc: Create new task to install pdb file

Previously the msvc tool was re-using the install_task set up by ccroot
in apply_link by appending files to install_task.sources.

This is problematic because the install task is posted by the time the
call to install_files returns and the post method of the install task
copies files from sources to inputs and inputs as the list of files
that get installed.  This usually worked due to the fact that the
install_task does not guard against getting posted multiple times.  In
some situations such as installing and building a single target using
the --targets flag this was not working and pdb files would not be
installed.

This updates the msvc tool to create a separate task to install the
pdb files instead of re-using the existing install_task.  This fixes
the issue observed with pdb files not being installed when building and
installing a single target and is also consistent with how other files
are being installed from ccroot such as in apply_implib and apply_vnum.

Change-Id: I9fc53061847453fdb5cf105f2276a2eab5fd43b4
Type: Bug Fix
Signed-off-by: Thomas Nagy <tnagy2pow10@gmail.com>
This commit is contained in:
Josh Bartel 2014-06-10 15:47:28 -05:00 committed by Thomas Nagy
parent 81c3ec0bf3
commit a7eb3d811b
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
1 changed files with 2 additions and 4 deletions

View File

@ -872,10 +872,8 @@ def apply_flags_msvc(self):
pdbnode = self.link_task.outputs[0].change_ext('.pdb')
self.link_task.outputs.append(pdbnode)
try:
self.install_task.source.append(pdbnode)
except AttributeError:
pass
if getattr(self, 'install_task', None):
self.pdb_install_task = self.bld.install_files(self.install_task.dest, pdbnode, env=self.env)
break