aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Nicolodi <daniele@grinta.net>2023-04-08 02:23:08 +0200
committerEli Schwartz <eschwartz93@gmail.com>2023-04-14 16:20:23 -0400
commit285e0d3c597d17fb980d95bda1d153f3e2829bcf (patch)
treec4b0c6b1f0e7a91d640c3511e84bb7eb7c12ef01
parent3bc2236c59249f44f20f8b52ddcd7a44938ea2f0 (diff)
downloadmeson-285e0d3c597d17fb980d95bda1d153f3e2829bcf.zip
meson-285e0d3c597d17fb980d95bda1d153f3e2829bcf.tar.gz
meson-285e0d3c597d17fb980d95bda1d153f3e2829bcf.tar.bz2
mbuild: .pdb files are created only when debug symbols are enabled
This is the same fix as the one in #10800 for shared libraries but applied to executables instead.
-rw-r--r--mesonbuild/build.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 2f325ae..4182cdc 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1893,9 +1893,13 @@ class Executable(BuildTarget):
else:
self.import_filename = self.gcc_import_filename
- if machine.is_windows() and ('cs' in self.compilers or
- self.uses_rust() or
- self.get_using_msvc()):
+ create_debug_file = (
+ machine.is_windows()
+ and ('cs' in self.compilers or self.uses_rust() or self.get_using_msvc())
+ # .pdb file is created only when debug symbols are enabled
+ and self.environment.coredata.get_option(OptionKey("debug"))
+ )
+ if create_debug_file:
self.debug_filename = self.name + '.pdb'
def get_default_install_dir(self) -> T.Tuple[str, str]:
@@ -2139,14 +2143,14 @@ class SharedLibrary(BuildTarget):
prefix = ''
# Import library is called foo.dll.lib
self.import_filename = f'{self.name}.dll.lib'
- # Debug files(.pdb) is only created with debug buildtype
+ # .pdb file is only created when debug symbols are enabled
create_debug_file = self.environment.coredata.get_option(OptionKey("debug"))
elif self.get_using_msvc():
# Shared library is of the form foo.dll
prefix = ''
# Import library is called foo.lib
self.import_filename = self.vs_import_filename
- # Debug files(.pdb) is only created with debug buildtype
+ # .pdb file is only created when debug symbols are enabled
create_debug_file = self.environment.coredata.get_option(OptionKey("debug"))
# Assume GCC-compatible naming
else: