compilers: Error if invalid linker selected

pull/6789/head
Dylan Baker 5 years ago
parent 6a5fdbf995
commit b8294b4436
  1. 4
      mesonbuild/compilers/mixins/gnu.py
  2. 4
      mesonbuild/compilers/mixins/visualstudio.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)]

@ -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):

Loading…
Cancel
Save