diff options
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index df3f37b..5c382a5 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1191,12 +1191,18 @@ class SharedLibrary(BuildTarget): # Visual Studio module-definitions file 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) - # link_depends can be an absolute path or relative to self.subdir - self.link_depends.append(path) + if isinstance(path, str): + 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) + # link_depends can be an absolute path or relative to self.subdir + self.link_depends.append(path) + elif isinstance(path, File): + # When passing a generated file. + self.vs_module_defs = path + # link_depends can be an absolute path or relative to self.subdir + self.link_depends.append(path.absolute_path(environment.source_dir, environment.build_dir)) def check_unknown_kwargs(self, kwargs): self.check_unknown_kwargs_int(kwargs, known_lib_kwargs) |