Merge branch 'msvc_pdb_fix2' into 'master'

msvc_pdb: check task class to not append output to wrong class task, like winres

See merge request ita1024/waf!2267
This commit is contained in:
Alibek Omarov 2019-11-07 19:02:38 +00:00
commit 1ef88905c3
1 changed files with 8 additions and 1 deletions

View File

@ -2,7 +2,8 @@
# encoding: utf-8
# Rafaël Kooi 2019
from waflib import TaskGen, Tools
from waflib import TaskGen, Tools, Task
@TaskGen.feature('c', 'cxx', 'fc')
@TaskGen.after_method('propagate_uselib_vars')
def add_pdb_per_object(self):
@ -16,6 +17,12 @@ def add_pdb_per_object(self):
link_task = getattr(self, 'link_task', None)
for task in self.compiled_tasks:
# Check for task class, otherwise we may add flags or PDB node
# to wrong file, like .rc's
tup = tuple(y for y in [Task.classes.get(x) for x in ('c', 'cxx', 'fc')] if y)
if not isinstance(task, tup):
continue
node = task.outputs[0].change_ext('.pdb')
pdb_flag = '/Fd:' + node.abspath()