From beb1f00f3bca05a0d9bd30a115da2621f43e2b73 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Sat, 27 Oct 2018 22:08:06 -0700 Subject: [PATCH] Hoist gen_vs_module_defs_args from Gnu to GnuLike. Support vs_module_defs when cross-compiling to Windows with clang. Fixes #4434. --- mesonbuild/compilers/compilers.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 137b3f7d6..8adacefec 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1439,6 +1439,16 @@ class GnuLikeCompiler(abc.ABC): def gnu_symbol_visibility_args(self, vistype): return gnu_symbol_visibility_args[vistype] + def gen_vs_module_defs_args(self, defsfile): + if not isinstance(defsfile, str): + raise RuntimeError('Module definitions file should be str') + # On Windows targets, .def files may be specified on the linker command + # line like an object file. + if self.compiler_type.is_windows_compiler: + return [defsfile] + # For other targets, discard the .def file. + return [] + class GnuCompiler(GnuLikeCompiler): """ @@ -1477,16 +1487,6 @@ class GnuCompiler(GnuLikeCompiler): def get_pch_suffix(self): return 'gch' - def gen_vs_module_defs_args(self, defsfile): - if not isinstance(defsfile, str): - raise RuntimeError('Module definitions file should be str') - # On Windows targets, .def files may be specified on the linker command - # line like an object file. - if self.compiler_type.is_windows_compiler: - return [defsfile] - # For other targets, discard the .def file. - return [] - def get_gui_app_args(self, value): if self.compiler_type.is_windows_compiler and value: return ['-mwindows']