diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-03-09 16:53:26 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-03-09 16:55:08 -0700 |
commit | 747061795393a1f4e8ac7d9f3d297b733a34230b (patch) | |
tree | e0c84afcb849312bbcbf6fec8d19b18cd72cb09f /run_project_tests.py | |
parent | fc8fffaf47a7cddeaae16a368f54e4aa87a4f4b5 (diff) | |
download | meson-747061795393a1f4e8ac7d9f3d297b733a34230b.zip meson-747061795393a1f4e8ac7d9f3d297b733a34230b.tar.gz meson-747061795393a1f4e8ac7d9f3d297b733a34230b.tar.bz2 |
project_tests: Add the option to the test format to mark the language
This is needed when mixing D and C code, as it's possible to end up
witha combination of linkers and compilres such that C produces pdb
files but D does not.
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-x | run_project_tests.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 1ae151b..3b20025 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -96,6 +96,7 @@ class InstalledFile: self.path = raw['file'] self.typ = raw['type'] self.platform = raw.get('platform', None) + self.language = raw.get('language', 'c') # type: str version = raw.get('version', '') # type: str if version: @@ -111,6 +112,13 @@ class InstalledFile: (env.machines.host.is_windows() and compiler in {'pgi', 'dmd', 'ldc'})): canonical_compiler = 'msvc' + has_pdb = False + if self.language in {'c', 'cpp'}: + has_pdb = canonical_compiler == 'msvc' + elif self.language == 'd': + # dmd's optlink does not genearte pdb iles + has_pdb = env.coredata.compilers.host['d'].linker.id in {'link', 'lld-link'} + # Abort if the platform does not match matches = { 'msvc': canonical_compiler == 'msvc', @@ -155,7 +163,7 @@ class InstalledFile: elif self.typ == 'pdb': if self.version: p = p.with_name('{}-{}'.format(p.name, self.version[0])) - return p.with_suffix('.pdb') if canonical_compiler == 'msvc' else None + return p.with_suffix('.pdb') if has_pdb else None elif self.typ == 'implib' or self.typ == 'implibempty': if env.machines.host.is_windows() and canonical_compiler == 'msvc': # only MSVC doesn't generate empty implibs |