diff options
| author | Xavier Claessens <xavier.claessens@collabora.com> | 2023-10-16 14:22:12 -0400 |
|---|---|---|
| committer | Xavier Claessens <xclaesse@gmail.com> | 2023-10-19 08:13:57 -0400 |
| commit | 361f7484d2fe9d1cf03b66a66d785618694aa62c (patch) | |
| tree | 24c8941baf150ba43706697f67d1c66443d82ea8 /mesonbuild/compilers/d.py | |
| parent | 890dd31cb0cdfaca6ddf483c8d8ba3b4c1bcb753 (diff) | |
| download | meson-361f7484d2fe9d1cf03b66a66d785618694aa62c.tar.gz | |
Remove duplicated code to canonicalize b_vscrt option value
Add a common function that infers vscrt from buildtype in Compiler base
class.
Diffstat (limited to 'mesonbuild/compilers/d.py')
| -rw-r--r-- | mesonbuild/compilers/d.py | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py index 05f3b7d8d..d8a72fdf3 100644 --- a/mesonbuild/compilers/d.py +++ b/mesonbuild/compilers/d.py @@ -379,31 +379,7 @@ class DmdLikeCompilerMixin(CompilerMixinBase): def _get_crt_args(self, crt_val: str, buildtype: str) -> T.List[str]: if not self.info.is_windows(): return [] - - if crt_val in self.mscrt_args: - return self.mscrt_args[crt_val] - assert crt_val in {'from_buildtype', 'static_from_buildtype'} - - dbg = 'mdd' - rel = 'md' - if crt_val == 'static_from_buildtype': - dbg = 'mtd' - rel = 'mt' - - # Match what build type flags used to do. - if buildtype == 'plain': - return [] - elif buildtype == 'debug': - return self.mscrt_args[dbg] - elif buildtype == 'debugoptimized': - return self.mscrt_args[rel] - elif buildtype == 'release': - return self.mscrt_args[rel] - elif buildtype == 'minsize': - return self.mscrt_args[rel] - else: - assert buildtype == 'custom' - raise EnvironmentException('Requested C runtime based on buildtype, but buildtype is "custom".') + return self.mscrt_args[self.get_crt_val(crt_val, buildtype)] def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str, suffix: str, soversion: str, |
