aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2017-05-07 23:20:50 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2017-05-16 19:56:32 +0100
commit66a6ea984bc43d9ac144e22cf411c16e9f911bb3 (patch)
tree568e17708dce7c01379f2c370f131739e8a2b234 /mesonbuild/build.py
parentabd12b69eab4340eb5705a57e86ea254854cec24 (diff)
downloadmeson-66a6ea984bc43d9ac144e22cf411c16e9f911bb3.zip
meson-66a6ea984bc43d9ac144e22cf411c16e9f911bb3.tar.gz
meson-66a6ea984bc43d9ac144e22cf411c16e9f911bb3.tar.bz2
Allow vs_module_defs to use a custom_target
Allow vs_module_defs to use a custom_target Add a test and update documentation
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 ce6405b..c1e192d 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1281,6 +1281,8 @@ class SharedLibrary(BuildTarget):
# Visual Studio module-definitions file
if 'vs_module_defs' in kwargs:
path = kwargs['vs_module_defs']
+ if hasattr(path, 'held_object'):
+ path = path.held_object
if isinstance(path, str):
if os.path.isabs(path):
self.vs_module_defs = File.from_absolute_file(path)
@@ -1291,10 +1293,15 @@ class SharedLibrary(BuildTarget):
# When passing a generated file.
self.vs_module_defs = path
self.link_depends.append(path)
+ elif hasattr(path, 'get_filename'):
+ # When passing output of a Custom Target
+ path = File.from_built_file(path.subdir, path.get_filename())
+ self.vs_module_defs = path
+ self.link_depends.append(path)
else:
raise InvalidArguments(
'Shared library vs_module_defs must be either a string, '
- 'or a file object')
+ 'a file object or a Custom Target')
def check_unknown_kwargs(self, kwargs):
self.check_unknown_kwargs_int(kwargs, known_lib_kwargs)