aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers.py
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2017-05-07 22:20:54 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2017-05-12 18:56:43 +0300
commite99cfdfbc73ae4dd6dfd37fc674088aac01ec63e (patch)
tree404e4dacb21caa8ef7d871ecf771a6c088b87da6 /mesonbuild/compilers.py
parent1e14438a380c4c9591f94001d5389caf4c323004 (diff)
downloadmeson-e99cfdfbc73ae4dd6dfd37fc674088aac01ec63e.zip
meson-e99cfdfbc73ae4dd6dfd37fc674088aac01ec63e.tar.gz
meson-e99cfdfbc73ae4dd6dfd37fc674088aac01ec63e.tar.bz2
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.
Diffstat (limited to 'mesonbuild/compilers.py')
-rw-r--r--mesonbuild/compilers.py10
1 files changed, 10 insertions, 0 deletions
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):