diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-03-12 13:17:36 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-03-17 10:40:39 -0700 |
commit | b8294b4436f7a187cd8cfae02554ce0140428e78 (patch) | |
tree | a845694a514c58ff9ae9c62fe1a0bca4d8fc4d5d | |
parent | 6a5fdbf995c46e17b9e1bbd0516772b35e2786ac (diff) | |
download | meson-b8294b4436f7a187cd8cfae02554ce0140428e78.zip meson-b8294b4436f7a187cd8cfae02554ce0140428e78.tar.gz meson-b8294b4436f7a187cd8cfae02554ce0140428e78.tar.bz2 |
compilers: Error if invalid linker selected
-rw-r--r-- | mesonbuild/compilers/mixins/gnu.py | 4 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/visualstudio.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/compilers/mixins/gnu.py b/mesonbuild/compilers/mixins/gnu.py index ae4b7db..4c8ca0b 100644 --- a/mesonbuild/compilers/mixins/gnu.py +++ b/mesonbuild/compilers/mixins/gnu.py @@ -304,6 +304,10 @@ class GnuLikeCompiler(metaclass=abc.ABCMeta): @classmethod def use_linker_args(cls, linker: str) -> T.List[str]: + if linker not in {'gold', 'bfd', 'lld'}: + raise mesonlib.MesonException( + 'Unsupported linker, only bfd, gold, and lld are supported, ' + 'not {}.'.format(linker)) return ['-fuse-ld={}'.format(linker)] diff --git a/mesonbuild/compilers/mixins/visualstudio.py b/mesonbuild/compilers/mixins/visualstudio.py index 44aefc8..d0004ce 100644 --- a/mesonbuild/compilers/mixins/visualstudio.py +++ b/mesonbuild/compilers/mixins/visualstudio.py @@ -366,10 +366,6 @@ class VisualStudioLikeCompiler(metaclass=abc.ABCMeta): def get_argument_syntax(self) -> str: return 'msvc' - @classmethod - def use_linker_args(cls, linker: str) -> T.List[str]: - return [] - class MSVCCompiler(VisualStudioLikeCompiler): |