summaryrefslogtreecommitdiff
path: root/mesonbuild/templates
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2025-11-23 20:14:42 +0000
committerJussi Pakkanen <jussi.pakkanen@mailbox.org>2025-12-01 16:55:18 +0200
commit6419b22f6183d87c92d42bd3a99aa2787cb13e08 (patch)
tree4905fdfce792e21752761e065b0cbff6f62eff99 /mesonbuild/templates
parentb3a0f9ce6147b5b2f6fbfdb257138e1f3a796086 (diff)
downloadmeson-6419b22f6183d87c92d42bd3a99aa2787cb13e08.tar.gz
templates: fix --executable
* In 1.7.1, the behaviour of --executable was to just ignore it. * After my recent 9104bb616766bd9a05f0b2f280359463d32e227d, the behaviour was that we'd require, for --executable xyz, xyz.c to exist or we'd fail to generate. Neither are good! Instead, create the sample source file w/ the project name, but call the executable whatever the user passed with `--executable`. Bug: https://github.com/mesonbuild/meson/issues/15286
Diffstat (limited to 'mesonbuild/templates')
-rw-r--r--mesonbuild/templates/sampleimpl.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/templates/sampleimpl.py b/mesonbuild/templates/sampleimpl.py
index 00735c498..46f9a70aa 100644
--- a/mesonbuild/templates/sampleimpl.py
+++ b/mesonbuild/templates/sampleimpl.py
@@ -133,7 +133,7 @@ class FileImpl(SampleImpl):
def __init__(self, args: Arguments):
super().__init__(args)
- self.sources = args.srcfiles if args.srcfiles else [Path(f'{self.executable_name}.{self.source_ext}')]
+ self.sources = args.srcfiles if args.srcfiles else [Path(f'{self.name}.{self.source_ext}')]
def create_executable(self) -> None:
source_name = f'{self.lowercase_token}.{self.source_ext}'