compilers: Error if invalid linker selected

This commit is contained in:
Dylan Baker 2020-03-12 13:17:36 -07:00
parent 6a5fdbf995
commit b8294b4436
2 changed files with 4 additions and 4 deletions

View File

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

View File

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