|
|
|
@ -1274,11 +1274,13 @@ class VisualStudioLikeLinkerMixin(DynamicLinkerBase): |
|
|
|
|
|
|
|
|
|
def __init__(self, exelist: T.List[str], for_machine: mesonlib.MachineChoice, |
|
|
|
|
prefix_arg: T.Union[str, T.List[str]], always_args: T.List[str], *, |
|
|
|
|
version: str = 'unknown version', direct: bool = True, machine: str = 'x86'): |
|
|
|
|
version: str = 'unknown version', direct: bool = True, machine: str = 'x86', |
|
|
|
|
rsp_syntax: RSPFileSyntax = RSPFileSyntax.MSVC): |
|
|
|
|
# There's no way I can find to make mypy understand what's going on here |
|
|
|
|
super().__init__(exelist, for_machine, prefix_arg, always_args, version=version) |
|
|
|
|
self.machine = machine |
|
|
|
|
self.direct = direct |
|
|
|
|
self.rsp_syntax = rsp_syntax |
|
|
|
|
|
|
|
|
|
def invoked_by_compiler(self) -> bool: |
|
|
|
|
return not self.direct |
|
|
|
@ -1322,7 +1324,7 @@ class VisualStudioLikeLinkerMixin(DynamicLinkerBase): |
|
|
|
|
return self._apply_prefix(['/IMPLIB:' + implibname]) |
|
|
|
|
|
|
|
|
|
def rsp_file_syntax(self) -> RSPFileSyntax: |
|
|
|
|
return RSPFileSyntax.MSVC |
|
|
|
|
return self.rsp_syntax |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MSVCDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker): |
|
|
|
@ -1335,9 +1337,10 @@ class MSVCDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker): |
|
|
|
|
exelist: T.Optional[T.List[str]] = None, |
|
|
|
|
prefix: T.Union[str, T.List[str]] = '', |
|
|
|
|
machine: str = 'x86', version: str = 'unknown version', |
|
|
|
|
direct: bool = True): |
|
|
|
|
direct: bool = True, rsp_syntax: RSPFileSyntax = RSPFileSyntax.MSVC): |
|
|
|
|
super().__init__(exelist or ['link.exe'], for_machine, |
|
|
|
|
prefix, always_args, machine=machine, version=version, direct=direct) |
|
|
|
|
prefix, always_args, machine=machine, version=version, direct=direct, |
|
|
|
|
rsp_syntax=rsp_syntax) |
|
|
|
|
|
|
|
|
|
def get_always_args(self) -> T.List[str]: |
|
|
|
|
return self._apply_prefix(['/release']) + super().get_always_args() |
|
|
|
@ -1359,9 +1362,10 @@ class ClangClDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker): |
|
|
|
|
exelist: T.Optional[T.List[str]] = None, |
|
|
|
|
prefix: T.Union[str, T.List[str]] = '', |
|
|
|
|
machine: str = 'x86', version: str = 'unknown version', |
|
|
|
|
direct: bool = True): |
|
|
|
|
direct: bool = True, rsp_syntax: RSPFileSyntax = RSPFileSyntax.MSVC): |
|
|
|
|
super().__init__(exelist or ['lld-link.exe'], for_machine, |
|
|
|
|
prefix, always_args, machine=machine, version=version, direct=direct) |
|
|
|
|
prefix, always_args, machine=machine, version=version, direct=direct, |
|
|
|
|
rsp_syntax=rsp_syntax) |
|
|
|
|
|
|
|
|
|
def get_output_args(self, outputname: str) -> T.List[str]: |
|
|
|
|
# If we're being driven indirectly by clang just skip /MACHINE |
|
|
|
|