From cfd57180eef9036c7167c5682b9f3055a540fccc Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Tue, 7 May 2024 21:46:55 +0300 Subject: implement @PLAINNAME0@ and @BASENAME0@ @PLAINNAME@ and @BASENAME@ cannot be used in custom_target() with multiple inputs. For those, similar macros are needed with an index. Fixes #13164 --- mesonbuild/utils/universal.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mesonbuild/utils') diff --git a/mesonbuild/utils/universal.py b/mesonbuild/utils/universal.py index ce9afd96b..c831169c5 100644 --- a/mesonbuild/utils/universal.py +++ b/mesonbuild/utils/universal.py @@ -1744,6 +1744,8 @@ def get_filenames_templates_dict(inputs: T.List[str], outputs: T.List[str]) -> T If there is more than one input file, the following keys are also created: @INPUT0@, @INPUT1@, ... one for each input file + @PLAINNAME0@, @PLAINNAME1@, ... one for each input file + @BASENAME0@, @BASENAME1@, ... one for each input file If there is more than one output file, the following keys are also created: @@ -1757,6 +1759,9 @@ def get_filenames_templates_dict(inputs: T.List[str], outputs: T.List[str]) -> T for (ii, vv) in enumerate(inputs): # Write out @INPUT0@, @INPUT1@, ... values[f'@INPUT{ii}@'] = vv + plain = os.path.basename(vv) + values[f'@PLAINNAME{ii}@'] = plain + values[f'@BASENAME{ii}@'] = os.path.splitext(plain)[0] if len(inputs) == 1: # Just one value, substitute @PLAINNAME@ and @BASENAME@ values['@PLAINNAME@'] = plain = os.path.basename(inputs[0]) -- cgit v1.2.3