diff options
Diffstat (limited to 'mesonbuild/compilers/mixins/visualstudio.py')
| -rw-r--r-- | mesonbuild/compilers/mixins/visualstudio.py | 69 |
1 files changed, 1 insertions, 68 deletions
diff --git a/mesonbuild/compilers/mixins/visualstudio.py b/mesonbuild/compilers/mixins/visualstudio.py index edb104d0c..5fe85996d 100644 --- a/mesonbuild/compilers/mixins/visualstudio.py +++ b/mesonbuild/compilers/mixins/visualstudio.py @@ -61,17 +61,6 @@ msvc_buildtype_args = { 'custom': [], } # type: typing.Dict[str, typing.List[str]] -msvc_buildtype_linker_args = { - 'plain': [], - 'debug': [], - 'debugoptimized': [], - # The otherwise implicit REF and ICF linker optimisations are disabled by - # /DEBUG. REF implies ICF. - 'release': ['/OPT:REF'], - 'minsize': ['/INCREMENTAL:NO', '/OPT:REF'], - 'custom': [], -} # type: typing.Dict[str, typing.List[str]] - msvc_optimization_args = { '0': [], 'g': ['/O0'], @@ -133,31 +122,18 @@ class VisualStudioLikeCompiler(metaclass=abc.ABCMeta): self.machine = 'x86' else: self.machine = target + self.linker.machine = self.machine # Override CCompiler.get_always_args def get_always_args(self) -> typing.List[str]: return self.always_args - def get_linker_debug_crt_args(self) -> typing.List[str]: - """ - Arguments needed to select a debug crt for the linker - - Sometimes we need to manually select the CRT (C runtime) to use with - MSVC. One example is when trying to link with static libraries since - MSVC won't auto-select a CRT for us in that case and will error out - asking us to select one. - """ - return ['/MDd'] - def get_buildtype_args(self, buildtype: str) -> typing.List[str]: args = msvc_buildtype_args[buildtype] if self.id == 'msvc' and mesonlib.version_compare(self.version, '<18.0'): args = [arg for arg in args if arg != '/Gw'] return args - def get_buildtype_linker_args(self, buildtype: str) -> typing.List[str]: - return msvc_buildtype_linker_args[buildtype] - def get_pch_suffix(self) -> str: return 'pch' @@ -197,23 +173,6 @@ class VisualStudioLikeCompiler(metaclass=abc.ABCMeta): def get_dependency_gen_args(self, outtarget: str, outfile: str) -> typing.List[str]: return [] - def get_linker_exelist(self) -> typing.List[str]: - # FIXME, should have same path as compiler. - # FIXME, should be controllable via cross-file. - if self.id == 'clang-cl': - return ['lld-link'] - else: - return ['link'] - - def get_linker_always_args(self) -> typing.List[str]: - return ['/nologo'] - - def get_linker_output_args(self, outputname: str) -> typing.List[str]: - return ['/MACHINE:' + self.machine, '/OUT:' + outputname] - - def get_linker_search_args(self, dirname: str) -> typing.List[str]: - return ['/LIBPATH:' + dirname] - def linker_to_compiler_args(self, args: typing.List[str]) -> typing.List[str]: return ['/link'] + args @@ -228,12 +187,6 @@ class VisualStudioLikeCompiler(metaclass=abc.ABCMeta): def get_pic_args(self) -> typing.List[str]: return [] # PIC is handled by the loader on Windows - def gen_export_dynamic_link_args(self, env: 'Environment') -> typing.List[str]: - return [] # Not applicable with MSVC - - def get_std_shared_lib_link_args(self) -> typing.List[str]: - return ['/DLL'] - def gen_vs_module_defs_args(self, defsfile: str) -> typing.List[str]: if not isinstance(defsfile, str): raise RuntimeError('Module definitions file should be str') @@ -249,9 +202,6 @@ class VisualStudioLikeCompiler(metaclass=abc.ABCMeta): "The name of the outputted import library" return ['/IMPLIB:' + implibname] - def build_rpath_args(self, build_dir: str, from_dir: str, rpath_paths: str, build_rpath: str, install_rpath: str) -> typing.List[str]: - return [] - def openmp_flags(self) -> typing.List[str]: return ['/openmp'] @@ -259,9 +209,6 @@ class VisualStudioLikeCompiler(metaclass=abc.ABCMeta): def thread_flags(self, env: 'Environment') -> typing.List[str]: return [] - def thread_link_flags(self, env: 'Environment') -> typing.List[str]: - return [] - @classmethod def unix_args_to_native(cls, args: typing.List[str]) -> typing.List[str]: result = [] @@ -331,16 +278,6 @@ class VisualStudioLikeCompiler(metaclass=abc.ABCMeta): args = ['/FS'] + args return args - def get_link_debugfile_args(self, targetfile: str) -> typing.List[str]: - pdbarr = targetfile.split('.')[:-1] - pdbarr += ['pdb'] - return ['/DEBUG', '/PDB:' + '.'.join(pdbarr)] - - def get_link_whole_for(self, args: typing.List[str]) -> typing.List[str]: - # Only since VS2015 - args = mesonlib.listify(args) - return ['/WHOLEARCHIVE:' + x for x in args] - def get_instruction_set_args(self, instruction_set: str) -> typing.Optional[typing.List[str]]: if self.is_64: return vs64_instruction_set_args.get(instruction_set, None) @@ -418,7 +355,3 @@ class VisualStudioLikeCompiler(metaclass=abc.ABCMeta): def get_argument_syntax(self) -> str: return 'msvc' - - def get_allow_undefined_link_args(self) -> typing.List[str]: - # link.exe - return ['/FORCE:UNRESOLVED'] |
