aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-04-03 18:12:18 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2016-04-03 18:12:18 +0300
commit873ffe782c178530e9c81da738d4b9ec9d13da86 (patch)
treef54327da69fce6788e9a5412258eadf444abf3d6 /mesonbuild/build.py
parente0792295bc6828ff9c603e8670628bce93ff248a (diff)
parent1713fa02970ca2a045b1635186fef718620bf1b3 (diff)
downloadmeson-873ffe782c178530e9c81da738d4b9ec9d13da86.zip
meson-873ffe782c178530e9c81da738d4b9ec9d13da86.tar.gz
meson-873ffe782c178530e9c81da738d4b9ec9d13da86.tar.bz2
Merge pull request #390 from nirbheek/msvc-module-defs
Add support for passing a module definitions file for exporting symbols while linking
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 3f480e8..2a91aa3 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -47,7 +47,7 @@ known_shlib_kwargs.update({'version' : True,
'soversion' : True,
'name_prefix' : True,
'name_suffix' : True,
- })
+ 'vs_module_defs' : True})
backslash_explanation = \
'''Compiler arguments have a backslash "\\" character. This is unfortunately not
@@ -703,6 +703,7 @@ class SharedLibrary(BuildTarget):
def __init__(self, name, subdir, subproject, is_cross, sources, objects, environment, kwargs):
self.version = None
self.soversion = None
+ self.vs_module_defs = None
super().__init__(name, subdir, subproject, is_cross, sources, objects, environment, kwargs);
if len(self.sources) > 0 and self.sources[0].endswith('.cs'):
prefix = 'lib'
@@ -726,6 +727,12 @@ class SharedLibrary(BuildTarget):
self.set_version(kwargs['version'])
if 'soversion' in kwargs:
self.set_soversion(kwargs['soversion'])
+ if 'vs_module_defs' in kwargs:
+ path = kwargs['vs_module_defs']
+ if (os.path.isabs(path)):
+ self.vs_module_defs = File.from_absolute_file(path)
+ else:
+ self.vs_module_defs = File.from_source_file(environment.source_dir, self.subdir, path)
def check_unknown_kwargs(self, kwargs):
self.check_unknown_kwargs_int(kwargs, known_shlib_kwargs)