diff options
| author | Andrew McNulty <amcn@users.noreply.github.com> | 2025-04-09 18:13:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-09 09:13:39 -0700 |
| commit | f23b0e7f35661645b7fec82025e72dffa189ab59 (patch) | |
| tree | 24725595e179c525e71acd2cc662c23084c365f2 /mesonbuild/compilers/compilers.py | |
| parent | 1afdac1bc4cbf9816e7109bbedef2825c4fe1155 (diff) | |
| download | meson-f23b0e7f35661645b7fec82025e72dffa189ab59.tar.gz | |
interpreter: Error if java sources used with non-jar target (#14424)
If the user specifies java sources as input to a non-jar build
target, raise an error with a message directing them to use the jar
target instead.
Fixes: https://github.com/mesonbuild/meson/issues/13870
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
| -rw-r--r-- | mesonbuild/compilers/compilers.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index a3b243dd9..3c1d58b4e 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -148,6 +148,12 @@ def is_assembly(fname: 'mesonlib.FileOrString') -> bool: suffix = fname.split('.')[-1] return suffix in assembler_suffixes +def is_java(fname: mesonlib.FileOrString) -> bool: + if isinstance(fname, mesonlib.File): + fname = fname.fname + suffix = fname.split('.')[-1] + return suffix in lang_suffixes['java'] + def is_llvm_ir(fname: 'mesonlib.FileOrString') -> bool: if isinstance(fname, mesonlib.File): fname = fname.fname |
