Generate pdb files during linking.

pull/684/head
Jussi Pakkanen 8 years ago
parent 5e047d9c91
commit b08581d394
  1. 1
      mesonbuild/backend/ninjabackend.py
  2. 11
      mesonbuild/compilers.py

@ -1669,6 +1669,7 @@ rule FORTRAN_DEP_HACK
linker) linker)
commands += linker.get_buildtype_linker_args(self.environment.coredata.get_builtin_option('buildtype')) commands += linker.get_buildtype_linker_args(self.environment.coredata.get_builtin_option('buildtype'))
commands += linker.get_option_link_args(self.environment.coredata.compiler_options) commands += linker.get_option_link_args(self.environment.coredata.compiler_options)
commands += linker.get_link_debugfile_args(outname)
if not(isinstance(target, build.StaticLibrary)): if not(isinstance(target, build.StaticLibrary)):
commands += self.environment.coredata.external_link_args[linker.get_language()] commands += self.environment.coredata.external_link_args[linker.get_language()]
if isinstance(target, build.Executable): if isinstance(target, build.Executable):

@ -357,6 +357,9 @@ class Compiler():
def get_compile_debugfile_args(self, rel_obj): def get_compile_debugfile_args(self, rel_obj):
return [] return []
def get_link_debugfile_args(self, rel_obj):
return []
class CCompiler(Compiler): class CCompiler(Compiler):
def __init__(self, exelist, version, is_cross, exe_wrapper=None): def __init__(self, exelist, version, is_cross, exe_wrapper=None):
super().__init__(exelist, version) super().__init__(exelist, version)
@ -1608,6 +1611,10 @@ class VisualStudioCCompiler(CCompiler):
pdbarr = rel_obj.split('.')[:-1] + ['pdb'] pdbarr = rel_obj.split('.')[:-1] + ['pdb']
return ['/Fd' + '.'.join(pdbarr)] return ['/Fd' + '.'.join(pdbarr)]
def get_link_debugfile_args(self, targetfile):
pdbarr = targetfile.split('.')[:-1] + ['pdb']
return ['/DEBUG', '/PDB:' + '.'.join(pdbarr)]
class VisualStudioCPPCompiler(VisualStudioCCompiler): class VisualStudioCPPCompiler(VisualStudioCCompiler):
def __init__(self, exelist, version, is_cross, exe_wrap): def __init__(self, exelist, version, is_cross, exe_wrap):
VisualStudioCCompiler.__init__(self, exelist, version, is_cross, exe_wrap) VisualStudioCCompiler.__init__(self, exelist, version, is_cross, exe_wrap)
@ -2284,6 +2291,10 @@ class VisualStudioLinker():
def unix_compile_flags_to_native(self, args): def unix_compile_flags_to_native(self, args):
return args[:] return args[:]
def get_link_debugfile_args(self, targetfile):
pdbarr = targetfile.split('.')[:-1] + ['pdb']
return ['/DEBUG', '/PDB:' + '.'.join(pdbarr)]
class ArLinker(): class ArLinker():
def __init__(self, exelist): def __init__(self, exelist):

Loading…
Cancel
Save