summaryrefslogtreecommitdiff
path: root/mesonbuild/templates/objcpptemplates.py
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2025-11-23 20:52:21 +0000
committerJussi Pakkanen <jussi.pakkanen@mailbox.org>2025-12-01 16:55:18 +0200
commitaed2444f75d2089872d37ad8c608321e39b2aa78 (patch)
tree17f3cf7be97f506faa9e629040849e24b0ace2fe /mesonbuild/templates/objcpptemplates.py
parent176edafdd6dd5549525223539dbc7f4a1f74ee24 (diff)
downloadmeson-aed2444f75d2089872d37ad8c608321e39b2aa78.tar.gz
templates: fix remaining languages for source file discovery too
I missed this in 9104bb616766bd9a05f0b2f280359463d32e227d as we were only testing whitelisted languages for source file discovery. Tests now handle all of these by using the map we have in compilers, as we need to know the suffix to use for the invalid source files we inject. Note that for tests, we mix explicit --lang in some cases and not others, which we could probably do better with. For these 'must fail' tests, I've stuck with explicit `--lang` to make sure we're testing what we want, but the others are perhaps up for debate. Bug: https://github.com/mesonbuild/meson/issues/15286
Diffstat (limited to 'mesonbuild/templates/objcpptemplates.py')
-rw-r--r--mesonbuild/templates/objcpptemplates.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/templates/objcpptemplates.py b/mesonbuild/templates/objcpptemplates.py
index 1f4bef431..c6eddd646 100644
--- a/mesonbuild/templates/objcpptemplates.py
+++ b/mesonbuild/templates/objcpptemplates.py
@@ -73,13 +73,17 @@ lib_objcpp_meson_template = '''project(
dependencies = [{dependencies}
]
+sources = [{source_files}
+
+]
+
# These arguments are only used to build the shared library
# not the executables that use the library.
lib_args = ['-DBUILDING_{utoken}']
lib = library(
'{lib_name}',
- '{source_file}',
+ [sources],
install : true,
objcpp_shared_args : lib_args,
dependencies : dependencies,
@@ -139,9 +143,13 @@ hello_objcpp_meson_template = '''project(
dependencies = [{dependencies}
]
+sources = [{source_files}
+
+]
+
exe = executable(
'{exe_name}',
- '{source_name}',
+ [sources],
dependencies : dependencies,
install : true,
)