aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-09-11 13:04:55 +0300
committerGitHub <noreply@github.com>2016-09-11 13:04:55 +0300
commitc334eeda76c1c4a5d7a150c7af5976ea7a73c7ad (patch)
tree1ca30772bb2a023ae65b0bbaf70a3cc2e43bf3a8 /mesonbuild/build.py
parent167deda6658315a7bbc553757b130be70ba827e2 (diff)
parent91c5f07a8efe550c4b64c72d0914108239fcc1c6 (diff)
downloadmeson-c334eeda76c1c4a5d7a150c7af5976ea7a73c7ad.zip
meson-c334eeda76c1c4a5d7a150c7af5976ea7a73c7ad.tar.gz
meson-c334eeda76c1c4a5d7a150c7af5976ea7a73c7ad.tar.bz2
Merge pull request #684 from mesonbuild/pdb
Create pdb files with MSVC
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 50abd52..f95922e 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -206,6 +206,8 @@ class BuildTarget():
self.link_targets = []
self.link_depends = []
self.filename = 'no_name'
+ # The file with debugging symbols
+ self.debug_filename = None
self.need_install = False
self.pch = {}
self.extra_args = {}
@@ -467,6 +469,15 @@ class BuildTarget():
def get_filename(self):
return self.filename
+ def get_debug_filename(self):
+ """
+ The name of the file that contains debugging symbols for this target
+
+ Returns None if there are no debugging symbols or if they are embedded
+ in the filename itself
+ """
+ return self.debug_filename
+
def get_extra_args(self, language):
return self.extra_args.get(language, [])
@@ -729,6 +740,11 @@ class Executable(BuildTarget):
self.filename = self.name
if self.suffix:
self.filename += '.' + self.suffix
+ # See determine_debug_filenames() in build.SharedLibrary
+ buildtype = environment.coredata.get_builtin_option('buildtype')
+ if compiler_is_msvc(self.sources, is_cross, environment) and \
+ buildtype.startswith('debug'):
+ self.debug_filename = self.prefix + self.name + '.pdb'
def type_suffix(self):
return "@exe"
@@ -754,6 +770,11 @@ class StaticLibrary(BuildTarget):
else:
self.suffix = 'a'
self.filename = self.prefix + self.name + '.' + self.suffix
+ # See determine_debug_filenames() in build.SharedLibrary
+ buildtype = environment.coredata.get_builtin_option('buildtype')
+ if compiler_is_msvc(self.sources, is_cross, environment) and \
+ buildtype.startswith('debug'):
+ self.debug_filename = self.prefix + self.name + '.pdb'
def type_suffix(self):
return "@sta"
@@ -776,6 +797,7 @@ class SharedLibrary(BuildTarget):
self.suffix = None
self.basic_filename_tpl = '{0.prefix}{0.name}.{0.suffix}'
self.determine_filenames(is_cross, environment)
+ self.determine_debug_filenames(is_cross, environment)
def determine_filenames(self, is_cross, env):
"""
@@ -865,6 +887,21 @@ class SharedLibrary(BuildTarget):
self.suffix = suffix
self.filename = self.filename_tpl.format(self)
+ def determine_debug_filenames(self, is_cross, env):
+ """
+ Determine the debug filename(s) using the prefix/name/etc detected in
+ determine_filenames() above.
+ """
+ buildtype = env.coredata.get_builtin_option('buildtype')
+ if compiler_is_msvc(self.sources, is_cross, env) and buildtype.startswith('debug'):
+ # Currently we only implement separate debug symbol files for MSVC
+ # since the toolchain does it for us. Other toolchains embed the
+ # debugging symbols in the file itself by default.
+ if self.soversion:
+ self.debug_filename = '{0.prefix}{0.name}-{0.soversion}.pdb'.format(self)
+ else:
+ self.debug_filename = '{0.prefix}{0.name}.pdb'.format(self)
+
def process_kwargs(self, kwargs, environment):
super().process_kwargs(kwargs, environment)
# Shared library version