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/asm.py | |
parent | 890dd31cb0cdfaca6ddf483c8d8ba3b4c1bcb753 (diff) | |
download | meson-361f7484d2fe9d1cf03b66a66d785618694aa62c.zip meson-361f7484d2fe9d1cf03b66a66d785618694aa62c.tar.gz meson-361f7484d2fe9d1cf03b66a66d785618694aa62c.tar.bz2 |
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/asm.py')
-rw-r--r-- | mesonbuild/compilers/asm.py | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/mesonbuild/compilers/asm.py b/mesonbuild/compilers/asm.py index 19f7b64..392a082 100644 --- a/mesonbuild/compilers/asm.py +++ b/mesonbuild/compilers/asm.py @@ -124,28 +124,7 @@ class NasmCompiler(Compiler): def get_crt_link_args(self, crt_val: str, buildtype: str) -> T.List[str]: if not self.info.is_windows(): return [] - if crt_val in self.crt_args: - return self.crt_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.crt_args[dbg] - elif buildtype == 'debugoptimized': - return self.crt_args[rel] - elif buildtype == 'release': - return self.crt_args[rel] - elif buildtype == 'minsize': - return self.crt_args[rel] - else: - assert buildtype == 'custom' - raise EnvironmentException('Requested C runtime based on buildtype, but buildtype is "custom".') + return self.crt_args[self.get_crt_val(crt_val, buildtype)] class YasmCompiler(NasmCompiler): id = 'yasm' |