diff options
author | David Seifert <soap@gentoo.org> | 2018-09-15 13:13:50 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-09-16 00:47:32 +0300 |
commit | 69ec001b0672094ab92c07f5e561c9c0525aef7b (patch) | |
tree | c4ca07ad57cf0eeacd8936599edbaae202e9d42e /mesonbuild/compilers/d.py | |
parent | 73b47e00250de335513172f0ed0284cd4ac31599 (diff) | |
download | meson-69ec001b0672094ab92c07f5e561c9c0525aef7b.zip meson-69ec001b0672094ab92c07f5e561c9c0525aef7b.tar.gz meson-69ec001b0672094ab92c07f5e561c9c0525aef7b.tar.bz2 |
Use enum instead of `int` for compiler variants
* Enums are strongly typed and make the whole
`gcc_type`/`clang_type`/`icc_type` distinction
redundant.
* Enums also allow extending via member functions,
which makes the code more generalisable.
Diffstat (limited to 'mesonbuild/compilers/d.py')
-rw-r--r-- | mesonbuild/compilers/d.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py index ee9e0c2..3d46390 100644 --- a/mesonbuild/compilers/d.py +++ b/mesonbuild/compilers/d.py @@ -17,8 +17,7 @@ import os.path, subprocess from ..mesonlib import EnvironmentException, version_compare, is_windows, is_osx from .compilers import ( - GCC_STANDARD, - GCC_OSX, + CompilerType, d_dmd_buildtype_args, d_gdc_buildtype_args, d_ldc_buildtype_args, @@ -152,12 +151,12 @@ class DCompiler(Compiler): if is_windows(): return [] elif is_osx(): - soname_args = get_gcc_soname_args(GCC_OSX, *args) + soname_args = get_gcc_soname_args(CompilerType.GCC_OSX, *args) if soname_args: return ['-Wl,' + ','.join(soname_args)] return [] - return get_gcc_soname_args(GCC_STANDARD, *args) + return get_gcc_soname_args(CompilerType.GCC_STANDARD, *args) def get_feature_args(self, kwargs, build_to_src): res = [] |