diff options
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 1 | ||||
-rw-r--r-- | mesonbuild/compilers.py | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 15f298b..cb007d4 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -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' diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index d020033..5a8f48a 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -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) |