From 2761131ff94489842da3988792c4c2b0d25a850c Mon Sep 17 00:00:00 2001 From: Thomas Li <47963215+lithomas1@users.noreply.github.com> Date: Fri, 9 Sep 2022 14:27:06 -0400 Subject: [PATCH] BUG: Don't add debug files as targets when not building in debug mode --- mesonbuild/build.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mesonbuild/build.py b/mesonbuild/build.py index bf8707195..1c8013ce5 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -2075,13 +2075,15 @@ class SharedLibrary(BuildTarget): prefix = '' # Import library is called foo.dll.lib self.import_filename = f'{self.name}.dll.lib' - create_debug_file = True + # Debug files(.pdb) is only created with debug buildtype + 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 - create_debug_file = True + # Debug files(.pdb) is only created with debug buildtype + create_debug_file = self.environment.coredata.get_option(OptionKey("debug")) # Assume GCC-compatible naming else: # Shared library is of the form libfoo.dll