summaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)Author
2025-12-11add clippy-json targetclippy-jsonJohn Turner
Add a clippy-json target to the ninja script. This is useful for rust-analyzer, which requires an "external check command" to function when not using cargo. This also changes the --emit option in the clippy script to "emit", without this, clippy will fail with errors about missing libraries. These would normally be created with the normal compilation target, but we can't rely on that, because if it fails, clippy-json never runs, and you won't get error messages to the LSP.
2025-12-11MPI detection: support Intel MPI on WindowsLisandro Dalcin
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2025-12-11MPI detection: do not look for mpicc on WindowsLisandro Dalcin
2025-12-11symbolextractor: implement on OS/2KO Myung-Hun
2025-12-10cmake: Fix version kwarg being added to static_library targetsRobotLeopard86
2025-12-08build: Add de-duplication for non-result targets in get_all_link_depsRobotLeopard86
2025-12-08dependencies/ui.py: Improve Vulkan detection on WindowsChun-wei Fan
There now exists a Windows Vulkan SDK for ARM64, and the latest Vulkan SDKs for x64 Windows also provides ARM64 libraries and binaries for cross-builds (and vice-versa). So, now we have the following in the Vulkan SDKs: * Bin-ARM64 and Lib-ARM64 in x64 Windows SDKs that contains ARM64 Vulkan binaries and libraries. * Bin-X64 and Lib-X64 in ARM64 Windows SDKs that contains x64 Vulkan binaries and libraries * SDKs after 1.4.x (or so) no longer ships 32-bit Windows binaries and libraries. This updates the Vulkan detection logic to account for these differences so that the correct library is picked up upon linking on Windows, especially when cross-compiling ARM64 binaries on x64 Windows, and vice versa, while maintaining compatibility with native and 32-bit builds.
2025-12-08compilers: clike: Deduplicate compile and link args from actually used arg listLeonid Zaburunov
Current behaviour is to loop over 'sys_args' list which contains both included and ignored compiler arguments. This could produce unexpected results when argument is both ignored and deduplicated. With the following changes, 'cleaned_sys_args' is used to ensure only included args are deduplicated. Example: CFLAGS (or 'c_args' as Meson option) has '-I${includedir} -L${libdir}' and LDFLAGS ('c_link_args') has '-L${libdir}'. Given CFLAGS value is wrong: -L entry belongs to LDFLAGS and thus should not be included in compiler argument list. Since we have -L in 'sys_args' list this entry will not be included as linker flag too! This is definitely not our goal: wrong entry should just be ignored. Some debug prints from Meson: C_ARGS: ['-I/opt/x64-compile/include', '-L/opt/x64-compile/lib'] LINKER_ARGS: ['-L/opt/x64-compile/lib'] RESULT_CARGS: ['-I/opt/x64-compile/include', '-D_FILE_OFFSET_BITS=64'] RESULT_LDARGS: [] (this is captured during compiler.find_library() call) And this is what we see after applying patch: C_ARGS: ['-I/opt/x64-compile/include', '-L/opt/x64-compile/lib'] LINKER_ARGS: ['-L/opt/x64-compile/lib'] RESULT_CARGS: ['-I/opt/x64-compile/include', '-D_FILE_OFFSET_BITS=64'] RESULT_LDARGS: ['-L/opt/x64-compile/lib']
2025-12-08qt.compile_moc: look for targets in dependenciesDavid Véron
If qt.compile_moc dependencies contain targets. The generated build does not exibit this dependency ie it is possible that the dependency build is run concurrently with MOC. Tell the generator that the MOC calls depends on targets in dependencies to be generated.
2025-12-08build|interpreter: use typed_kwargs for BuildTarget(install_tag)Dylan Baker
2025-12-08build|interpreter: use typed_kwargs for BuildTarget(link_args)Dylan Baker
2025-12-08interpreterbase: make ArithmeticNode and MesonOperator both use operator namesPaolo Bonzini
This avoids creating a dictionary every time an arithmetic operator is evaluated. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08mparser: move dictionaries to toplevelPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08mparser: tweak typing of accept_any, use it for comparisons.Paolo Bonzini
Tuples are inefficient, require the ability to use hash table lookup via either a frozenset or a dictionary. This also allows using accept_any with COMPARISON_MAP.
2025-12-08mparser: make comparison_map global uppercsaePaolo Bonzini
2025-12-08mparser: use a literal for arithmetic operatorsPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08make ctype the same as the printed ASTPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08mparser: lexer: check early against common tokensPaolo Bonzini
Identifiers are more common than strings, check against 'id' first. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08mparser: lexer: reduce regular expression usagePaolo Bonzini
Match single-character tokens a separate dictionary lookup. As pointed out by dcbaker, this is even faster than str.index and gives the syntax error check for free (via KeyError). It also enables splitting the special-case "if" in two parts, one for long tokens and one for short tokens, thus providing further speedup. This shaves about 2/3rds of the time spent in lex(). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08cargo: autodetect patch directoryPaolo Bonzini
Many crates that have a build.rs will usually require an overlay with the translated meson/meson.build file. To avoid having to create a .wrap file, when parsing Cargo.lock autodetect a directory in subproject/packagefiles/ and add it as the patch_directory. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08cargo: unify call to PackageDefinition.from_valuesPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08compilers/nvidia_hpc: compilers: move -std options to get_option_std_argsZephyr Lykos
Fixes: 6c88d9992192379511c4777c526786cbacf06167 Fixes: d3542ff690d0be723cfd3ebfaaac99290517837f Fixes: ff0c758b2a8015f7e7ca6fc627c29ef7bb4771b3
2025-12-08Use gnu_syms() on Haiku too.OscarL
2025-12-08compilers/xc32: add updates for v5.00Liza Chevalier
2025-12-08compilers/xc32: add _LTO_CACHE_VERSION to match GnuCompilerLiza Chevalier
2025-12-08style: use singe quotes for stringsLiza Chevalier
2025-12-08Bump version number for new development.Jussi Pakkanen
2025-12-08Bump version number for 1.10.Jussi Pakkanen
2025-12-05modules/cuda: Cuda 13.0 doesn't support the 10.1 profileDylan Baker
Even thought 12.8 and 12.9 do. So don't add then when we have 13
2025-12-05mesonmain: mark getting a language from another subproject as brokenDylan Baker
Currently, you can call `meson.get_compiler('c')`, if you haven't initialized 'c' for your project, but a super-project has initialized it. This happens because we check the wrong set of compilers (the global list vs the per-subproject one). Because of how fragile this is, we can mark it as broken an move on.
2025-12-05modules/cuda: Update arch flags for versions through 13.0Dylan Baker
This includes adding Blackwell support, as well as the deprecation of many older architectures in 12.9 and 13.0
2025-12-05modules/cuda: Update versions up through 13.0.2Dylan Baker
There is currently no Windows versions for 13.0.x I've marked with comments versions where a new release has the same version as the previous release. This should help reduce the number of list iterations, but also make easier to keep this list up to date.
2025-12-05modules/cuda: Pull driver table out of class bodyDylan Baker
This makes use of a small class to simplify the implementation
2025-12-04implement --env-set parameter manually in rustdoc scriptPaolo Bonzini
Rustdoc does not yet support the --env-set parameter, change the environment directly instead. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-04Remove --crate-type parameter filter from the rustdoc script.John Turner
Filtering out this flag causes the rustdoc script to fail when building docs for proc-macro crates. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-04interpreter: validate argument to string.split() for empty stringDylan Baker
The underlying Python implementation throws in this case, and I'm not sure what the correct result here would be if we allowed it. Convert to None and don't split? Split every character? I've gone with throwing InvalidArguments, which maintains the current behavior of "doesn't work" but with a nicer output. Any other change would require a FeatureNew anyway, and can wait till 1.11. Fixes: #15335
2025-12-01rust: Rust-ABI dynamic libraries do not support LTOPaolo Bonzini
Attempting to use LTO on e.g. a procedural macro crate fails with error: lto cannot be used for proc-macro crate type without -Zdylib-lto Do not return -Clto for such crate types. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-01compilers: pass target to get_lto_*_argsPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-01fix crate name in rust-project.jsonPaolo Bonzini
Include the real crate name, with "_" instead of "-" and without the Meson-specific "+foo" suffix. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-01Bump version number for rc2.Jussi Pakkanen
2025-12-01templates: simplify (whitespace, flatten array)Sam James
2025-12-01templates: fix remaining languages for source file discovery tooSam James
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
2025-12-01templates: fix --executableSam James
* 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
2025-11-30Bump sln_version_comment to 18 for vs2026 backend.Luke Elliott
Allows version selector to open the correct IDE.
2025-11-30Revert "Detect dependency changes in Windows rc compiler"Jussi Pakkanen
This reverts commit 632115ecff3bd7f9cb519098e04e0467b0cfd3a1.
2025-11-28Wrap `tarfile.fully_trusted_filter` in `staticmethod` for wrap file handling tooSebastian Dröge
That's how it is done in the other two places and without that one argument too many is passed to the filter function: ``` [...] File "/usr/lib/python3.14/site-packages/mesonbuild/wrap/wrap.py", line 607, in _get_file shutil.unpack_archive(path, extract_dir) ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.14/shutil.py", line 1432, in unpack_archive func(filename, extract_dir, **kwargs) ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.14/shutil.py", line 1349, in _unpack_tarfile tarobj.extractall(extract_dir, filter=filter) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.14/tarfile.py", line 2409, in extractall tarinfo, unfiltered = self._get_extract_tarinfo( ~~~~~~~~~~~~~~~~~~~~~~~~~^ member, filter_function, path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.14/tarfile.py", line 2496, in _get_extract_tarinfo filtered = filter_function(unfiltered, path) TypeError: fully_trusted_filter() takes 2 positional arguments but 3 were given ```
2025-11-28templates: Define a macro for pubic APIs on OS/2KO Myung-Hun
2025-11-28modules/snippets: Define a macro for public APIs on OS/2KO Myung-Hun
2025-11-28interpreter: Add a slice() method to arraysJouke Witteveen
This can come in handy for instance when a custom target creates both headers and sources. Slicing the output of a `to_list()` call provides convenient access to just the headers or just the sources.
2025-11-28Simplify to_list implementation for custom targetsJouke Witteveen