summaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
AgeCommit message (Collapse)Author
2025-12-22Merge branch 'clippy-json'John Turner
2025-12-22docs: update info on Cargo workspace objectPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-22docs: add release notes for rust.workspace()Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-20add clippy-json targetJohn 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. Also we add a "clippy-json-prereq" target, and invoke it in the clippy.py script. The prereq target tries to build as much of the project as possible with "-k0".
2025-12-08compilers/xc32: add updates for v5.00Liza Chevalier
2025-12-08Generate release notes for 1.10.Jussi Pakkanen
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-11-30Revert "Detect dependency changes in Windows rc compiler"Jussi Pakkanen
This reverts commit 632115ecff3bd7f9cb519098e04e0467b0cfd3a1.
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-23Add documentation for import std.Jussi Pakkanen
2025-11-18docs: release-note rewriter improvementsBenjamin Gilbert
2025-11-18Add support for the `counted_by` attributeTristan Partin
This is a new attribute released in GCC 15 and clang 18. It isn't supported in C++ compilers at the moment.
2025-11-14Add documentation for OS/2 supportKO Myung-Hun
2025-11-12rust: always pass -C default-linker-librariesPaolo Bonzini
This is often needed for mixed Rust/C programs, and in particular always needed with sanitizers. Add it always. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-12compilers: generalize -fembed-bitcodePaolo Bonzini
Produce -Cembed-bitcode for Rust, and also disable bitcode generation when LTO is not enabled.
2025-11-09compilers: support GCC incremental LTOSam James
GCC 15 supports incremental LTO (caching). It's the same feature as Clang's ThinLTO caching. Unfortunately, for the Clang ThinLTO cache support, we chose a pretty vendor-specific option name, and I don't want to worry about deprecating that (-Db_thinlto_cache and -Db_thinlto_cache_dir) at this time, so... Wire -Db_thinlto_cache and -Db_thinlto_cache_dir for GCC in the obvious and natural way. Other notes: * GCC, unlike Clang, requires the cache dir to exist. If the user passes an invalid directory, that's on them, but for our default in meson-private, we should os.mkdir() it, so we do that now too. * I did wonder about adding -flto-partition=cache, but when I asked about this last year [0], the response was that it has too many caveats. Though Honza did recently [1] suggest it has some utility, so I don't know. I'll ask about it. [0] https://inbox.sourceware.org/gcc-patches/vjeanwm7b2jnedzmbwww4cy6jf4prty6ypxvz7x5d463xw2mys@bxzxuvgfaplf/ [1] https://inbox.sourceware.org/gcc-patches/aLnAGpln6SXbjV7e@kam.mff.cuni.cz/ Closes: https://github.com/mesonbuild/meson/issues/14428
2025-11-05ExternalProgram: add cmd_array to complete the offferingStéphane Cerveau
In case of python and especially in the case of pyInstaller where the python command is meson.exe runpython, it should not be full path to be used but cmd_array. Fixing #13834
2025-11-04Add build target keyword parameter 'build_subdir' [v8]Keith Packard
Place the build products in a directory of the specified name somewhere within the build directory. This allows use of the target that includes a specific directory name: #include <subdir/configure.h> This also allows creating targets with the same basename by using different subdirectory names. v2: Move build_subdir to Target class. Error if path separator in build_dir v3: Rename to 'build_subdir' to make it clear that the name is appended to a meson-specific build directory, and does not provide the user with a way to define the overall meson build hierarchy. Allow build_subdir to include path separators. Support 'build_subdir' for configure_file. build_subdir must not exist in the source directory and must not contain '..' Add documentation and tests v4: Rebase and prepare for version 1.9.1 Add failing test case when build_subdir is present in the project. Add release note snippet v5: Clarify wording on restrictions on the value of build_subdir. Use the same wording in each place this restriction is described. v6: Move path validation to shared function, validate_build_subdir, instead of duplicating the tests in two places. v7: Update version numbers to 1.10.0 Add TypedDict updates. Remove spurious build_subdir instance variable v8: Oops, missed one version number update. Signed-off-by: Keith Packard <keithp@keithp.com>
2025-11-03mlog: add a new log file with the setup logsStéphane Cerveau
Add meson-setup.txt to keep the configure log out of the debug logs.
2025-10-29compilers: add Microchip XC32 compilerLiza Chevalier
The Microchip XC32 compiler is a GCC-based compiler implemented using existing GNU compiler classes. As the XC32 version and GCC version do not match mixins have been implemented to override versions used in versions checks where applicable.
2025-10-29Add snippets.symbol_visibility_header() methodXavier Claessens
Defining public API in a cross platform library is painful, especially on Windows. Since every library have to define pretty much the same macros, better do it in Meson.
2025-10-24modules/codegen: Add support for bison/byacc/yaccDylan Baker
This adds a similar wrapper to the Lex wrapper for yacc/bison/byacc. The interface is equivalent.
2025-10-24modules/codegen: Add wrapper for lex/flex/reflexDylan Baker
This module is a bit of a dumping ground for code generators, particularly ones that are important and non-trivial to wrap, either due to multiple implementations, major command line changes, or complex outputs (such as those that may output a directory structure). The initially provided method is for lex. It provides a simple wrapper that handles win_flex, reflex, flex, and generic lex.
2025-10-17cargo: document that it is recommended to use workspacesXavier Claessens
2025-10-17cargo: support workspacesPaolo Bonzini
Extracted from a patch by Xavier Claessens <xclaessens@netflix.com>
2025-10-15revert local_program()Eli Schwartz
This reverts https://github.com/mesonbuild/meson/pull/15107 Explicit objections regarding the design were raised and not answered, so it shouldn't have been merged. It needs to be discussed and revisited.
2025-10-15Add local_program() functionXavier Claessens
2025-10-15Add --check-diff to meson format, to show what should be formattedJulianne Swinoga
2025-10-14cargo: load a toplevel Cargo.lockPaolo Bonzini
2025-10-14Detect dependency changes in Windows rc compilerCharles Brunet
The `rc.exe` resource compiler neither provides *depfile* support nor allows showing includes, as is possible with C or C++ compilers. Therefore, changes to files included by the `.rc` file did not trigger recompilation of the resource file. A workaround was added to *meson* by calling the preprocessor on the `.rc` file to detect the included headers and adding the result as a dependency to the resource compilation.
2025-10-14Allow compiler methods to accept strings for include_directoriesCharles Brunet
2025-10-14compilers: clang: pass /nodefaultlibPaolo Bonzini
Work around https://github.com/llvm/llvm-project/issues/129881. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-14Generate Android cross files with env2mfile.Jussi Pakkanen
2025-10-08vala: Add method to get generated GIR from a build_targetDylan Baker
Fixes: #2296 Fixes: #4481 Fixes: #5968
2025-10-08vala: Add method to build_target to get generated vapi fileDylan Baker
Same as the previous, but for VAPI
2025-10-08vala: add a method to get a generated vala headerDylan Baker
This allows targets that don't link with a vala target to rely on the header generation.
2025-10-01Add documentation for naming scheme.Jussi Pakkanen
2025-10-01Allow CustomTarget source for i18n.xgettextCharles Brunet
Fixes #15054
2025-09-24compilers: clang: map -Db_vscrt to -fms-runtime-libPaolo Bonzini
The main complication here is that passing -fms-runtime-lib during compilation results in a warning: clang: error: argument unused during compilation: '-fms-runtime-lib=dll' [-Werror,-Wunused-command-line-argument] (https://github.com/mesonbuild/meson/actions/runs/17727020048/job/50369771571). So, for compilation expand the -D flags by hand, and only pass -fms-runtime-lib when linking. Fixes: #14571 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-09-03docs: belatedly generate release notes for 1.9.0Eli Schwartz
Fixes: https://github.com/mesonbuild/meson/issues/14984
2025-08-29interpreter: add dict.values() methodMarvin Scholz
Analogous to keys(), this returns the values in an array. It uses the same sorting as keys(), else it would quite confusing to return values in a different order than the corresponding keys.
2025-08-02swift: Pass C++ base compile options to swiftcKatalin Rebhan
2025-08-02Add swift_interoperability_mode kwargKatalin Rebhan
2025-08-01format: add --source-file-path argument for stdinCharles Brunet
Fixes #14539. Otherwise, .editorconfig is read from current working directory, and there is no way to know what file name to filter to choose the right section of editor config.
2025-07-29docs: update for mixed Rust/non-Rust sourcesPaolo Bonzini
2025-07-25Add swift_module_name target argumentKatalin Rebhan
Allows explicitly setting the Swift module name. By default, this is set to the target name, which we might want to change for various reasons, for example when it isn't a valid module name, or when building two targets with the same module name (e.g. a host and native variant).
2025-07-24Add suffix function to the fs moduleJouke Witteveen
2025-07-24Add -parse-as-library to Swift library targetsKatalin Rebhan
2025-07-21clang-tidy: run tool only on source files participating in targetsSahnvour
clang-tidy can't be ran as is on every source file and header
2025-07-19interpreter: Add a flatten() method to arraysDylan Baker
This allows users to do two things, flatten potentially nested arrays themselves, and, to safely convert types that may be an array to not an array. ```meson x = [meson.get_external_property('may_be_array)].flatten() ``` ```meson x = ['a', ['b', 'c']] assert(x.flatten() == ['a', 'b', 'c']) ```