Write pdb info to a specific file.

This commit is contained in:
Jussi Pakkanen 2016-08-17 23:26:32 +03:00
parent 58359c8fac
commit 5e047d9c91
2 changed files with 10 additions and 0 deletions

View File

@ -1521,6 +1521,7 @@ rule FORTRAN_DEP_HACK
commands+= compiler.get_include_args(i, False)
if self.environment.coredata.base_options.get('b_pch', False):
commands += self.get_pch_include_args(compiler, target)
commands += compiler.get_compile_debugfile_args(rel_obj)
crstr = ''
if target.is_cross:
crstr = '_CROSS'

View File

@ -352,6 +352,11 @@ class Compiler():
def get_colorout_args(self, colortype):
return []
# Some compilers (msvc) write debug info to a separate file.
# These args specify where it should be written.
def get_compile_debugfile_args(self, rel_obj):
return []
class CCompiler(Compiler):
def __init__(self, exelist, version, is_cross, exe_wrapper=None):
super().__init__(exelist, version)
@ -1599,6 +1604,10 @@ class VisualStudioCCompiler(CCompiler):
raise MesonException('Compiling test app failed.')
return not(warning_text in stde or warning_text in stdo)
def get_compile_debugfile_args(self, rel_obj):
pdbarr = rel_obj.split('.')[:-1] + ['pdb']
return ['/Fd' + '.'.join(pdbarr)]
class VisualStudioCPPCompiler(VisualStudioCCompiler):
def __init__(self, exelist, version, is_cross, exe_wrap):
VisualStudioCCompiler.__init__(self, exelist, version, is_cross, exe_wrap)