From e99cfdfbc73ae4dd6dfd37fc674088aac01ec63e Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Sun, 7 May 2017 22:20:54 +0100 Subject: Make vs_module_defs: do something for gcc on Windows as well Module definition files may be useful when building with gcc on Windows also (e.g. if the existing build uses them, if exports are aliased, if we were retro enough to export by ordinal, etc.) Add the .def file to the link command line when using gcc on Windows Run the appropriate windows tests irrespective of compiler. --- mesonbuild/compilers.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mesonbuild/compilers.py') diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index a36f184..c30e8fb 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -2451,6 +2451,16 @@ class GnuCompiler: def get_link_whole_for(self, args): return ['-Wl,--whole-archive'] + args + ['-Wl,--no-whole-archive'] + 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.gcc_type in (GCC_CYGWIN, GCC_MINGW): + return [defsfile] + # For other targets, discard the .def file. + return [] + class GnuCCompiler(GnuCompiler, CCompiler): def __init__(self, exelist, version, gcc_type, is_cross, exe_wrapper=None, defines=None): -- cgit v1.1