diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2023-07-21 01:00:44 -0400 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2023-07-31 11:00:22 -0700 |
commit | 404312c6ddc44b1e8f09a95a5c889184a25a384b (patch) | |
tree | 7141359c11cc4d06b30931e257ec0ee58112b63b | |
parent | 1cd16a7cc5a19b1d694f66d80f36f6ec4e119dcb (diff) | |
download | meson-404312c6ddc44b1e8f09a95a5c889184a25a384b.zip meson-404312c6ddc44b1e8f09a95a5c889184a25a384b.tar.gz meson-404312c6ddc44b1e8f09a95a5c889184a25a384b.tar.bz2 |
do better sanity check for vs_module_defs input
We allow custom_target() but check for it based on hasattr, ever since
the initial implementation way back in the day, in commit
66a6ea984bc43d9ac144e22cf411c16e9f911bb3. This is a bit broken because
various objects might support that but still aren't supposed to work. We
can actually just use isintance checks like we do immediately above,
which are more accurate and avoid crashes on things that aren't even
targets at all, like run_target(). Although custom_target indexes are
actually targets those didn't work either.
Fixes #9648
-rw-r--r-- | mesonbuild/build.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index cfb3a54..16bf412 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -2383,7 +2383,7 @@ class SharedLibrary(BuildTarget): elif isinstance(path, File): # When passing a generated file. self.vs_module_defs = path - elif hasattr(path, 'get_filename'): + elif isinstance(path, CustomTarget): # When passing output of a Custom Target self.vs_module_defs = File.from_built_file(path.subdir, path.get_filename()) else: |