summaryrefslogtreecommitdiff
path: root/docs/yaml/objects
AgeCommit message (Collapse)Author
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-10-14Allow compiler methods to accept strings for include_directoriesCharles Brunet
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-07-22Docs: standardize between list and array as arrayDylan Baker
When arrays were added they were called arrays. Because the are implemented with Python lists, that language started leaking into talking about Meson types. This is confusing. I've attempted, as much as possible, to move to using one name, array. I picked array because 1) It's the original name used, and 2) what Meson has are more properly arrays as they have a fixed length, while a critical property of lists are the ability to link and unlink them. There are a couple of places where the list language has leaked into the names of keyword arguments. I have not made any attempt to change those, I don't know if it's that useful or not.
2024-09-21Document get_variable(system)unknown
2024-09-11Fix typosspaette
2024-09-06alias_target with both_libs builds bothCharles Brunet
2024-08-05docs: fix example for feature.requireMarvin Scholz
The example incorrectly uses `then` after the if condition, which is incorrect meson syntax as meson does not support a `then` keyword.
2024-07-05Revert "Clarify mutable objects usage"Eli Schwartz
This reverts commit 9f02d0a3e5a5ffc82256391c244b1af38e41ef78. It turns out that this does introduce a behavioral change in existing users of ConfigurationData, which it wasn't supposed to (it was supposed to preserve behavior there, and add a new *warning* for EnvironmentVariables). This breaks projects such as pulseaudio, libvirt, and probably more. Roll back the change and try again after 1.5.0 is released. Fixes: #13372
2024-05-01Add required kwarg to compiler.{compiles,links,run}Tristan Partin
This is a similar commit to the one that added required to all the compiler.has* functions.
2024-04-23interpreter: implement the `name()` method for `ExternalLibraryHolder`Dylan Baker
This allows `cc.find_library().name()` to work, just like `dependency().name()`. Fixes: #13053
2024-04-14Clarify mutable objects usageXavier Claessens
Only Environment and ConfigurationData are mutable. However, only ConfigurationData becomes immutable after first use which is inconsistent. This deprecates modification after first use of Environment object and clarify documentation.
2024-02-25docs: clarify environment variables take only ExternalProgram.full_path()L. E. Segovia
Fixes #10901
2024-02-23env.unset methodCharles Brunet
2024-02-23doc: fix compiler.preprocess varargs documentationCharles Brunet
This was inherited from documentation of build target, but some sentences do not make sense in the context of the preprocessor.
2024-01-17compiler.preprocess: add depends kwargStas Sergeev
This patch adds 'depends' keyword to compiler.preprocess(). It allows to execute other targets before doing the preprocessing. Test-case is added to demonstrate that functionality: it generates the header before preprocessing the C source that uses that generated header. Thanks to @bruchar1 for getting this patch to work.
2023-11-24File: Add full_path() methodXavier Claessens
This is needed now that str.format() is not allowing it any more. It is also more consistent with other objects that have that method as well, such as build targets. Fixes: #12406
2023-11-14dependencies: allow get_variable to define multiple pkgconfig definesEli Schwartz
It was previously impossible to do this: ``` dep.get_pkgconfig_variable( 'foo', define_variable: ['prefix', '/usr', 'datadir', '/usr/share'], ) ``` since get_pkgconfig_variable mandated exactly two (if any) arguments. However, you could do this: ``` dep.get_variable( 'foo', pkgconfig_define: ['prefix', '/usr', 'datadir', '/usr/share'], ) ``` It would silently do the wrong thing, by defining "prefix" as `/usr=datadir=/usr/share`, which might not "matter" if only datadir was used in the "foo" variable as the unmodified value might be adequate. The actual intention of anyone writing such a meson.build is that they aren't sure whether the .pc file uses ${prefix} or ${datadir} (or which one gets used, might have changed between versions of that .pc file, even). A recent refactor made this into a hard error, which broke some projects that were doing this and inadvertently depending on some .pc file that only used the second variable. (This was "fine" since the result was essentially meaningful, and even resulted in behavior identical to the intended behavior if both projects were installed into the same prefix -- in which case there's nothing to remap.) Re-allow this. There are two ways we could re-allow this: - ignore it with a warning - add a new feature to allow actually doing this Since the use case which triggered this bug actually has a pretty good reason to want to do this, it makes sense to add the new feature. Fixes https://bugs.gentoo.org/916576 Fixes https://github.com/containers/bubblewrap/issues/609
2023-10-05Add env kwarg in generator.process()Nomura
2023-09-09clike compilers: fix cross_* functions' includeMoody Liu
A standard C library may not exist for cross-compile environments, thus the existence of <stdio.h> cannot be guaranteed. Use <stddef.h> instead, this header contains compiler-specific defines thus it usually comes from the compiler.
2023-09-07Add compiler.has_defineMarvin Scholz
Adds a new method to the compiler object, has_define. This makes it possible to check if a preprocessor macro/define is set or not. This is especially helpful if the define in question is empty, for example: #define MESON_EMPTY_DEFINE This would yield the same results as a missing define with the existing get_define method, as it would return an empty string for both cases. Therefore this additional method is needed.
2023-08-18docs: Provide example for feature.disable_auto_ifJan Janssen
2023-08-16Fix some random capitalization in feature.yamlTristan Partin
2023-08-11docs: Add more feature truth tablesJan Janssen
These are much easier to understand at a glance than free-form text.
2023-08-07Compiler: Add werror kwarg to compiles(), links() and run() methodsXavier Claessens
Fixes: #5399
2023-08-05fixup: since: 1.1.0 -> 1.3.0Milan Hauth
2023-08-05compiler: Add required keyword to has_* methodsXavier Claessens
add the "required" keyword to the functions has_function has_type has_member has_members has_argument has_multi_arguments has_link_argument has_multi_link_argument has_function_attribute Co-authored-by: Milan Hauth <milahu@gmail.com>
2023-06-21Clarify `environment` docs.Paolo Borelli
The object is not used only for tests, but also for `custom_target` etc.
2023-05-23docs: Fix some typos in feature option examplesNirbheek Chauhan
2023-04-11fix various spelling issuesJosh Soref
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-03-28doc: Fix some broken linksXavier Claessens
2023-02-15interpreter: add FeatureOption.enable_if and .disable_ifDylan Baker
This adds two new methods, that are conceptually related in the same way that `enable_auto_if` and `disable_auto_if` are. They are different however, in that they will always replace an `auto` value with an `enabled` or `disabled` value, or error if the feature is in the opposite state (calling `feature(disabled).enable_if(true)`, for example). This matters when the feature will be passed to dependency(required : …)`, which has different behavior when passed an enabled feature than an auto one. The `disable_if` method will be controversial, I'm sure, since it can be expressed via `feature.require()` (`feature.require(not condition) == feature.disable_if(condition)`). I have two defences of this: 1) `feature.require` is difficult to reason about, I would expect require to be equivalent to `feature.enable_if(condition)`, not to `feature.disable_if(not condition)`. 2) mixing `enable_if` and `disable_if` in the same call chain is much clearer than mixing `require` and `enable_if`: ```meson get_option('feat') \ .enable_if(foo) \ .disable_if(bar) \ .enable_if(opt) ``` vs ```meson get_option('feat') \ .enable_if(foo) \ .require(not bar) \ .enable_if(opt) ``` In the first chain it's immediately obvious what is happening, in the second, not so much, especially if you're not familiar with what `require` means.
2023-02-15interpreter: add a feature.enable_auto_ifDylan Baker
It's always been strange to me we don't have an opposite method of the `disable_auto_if` method, but I've been pressed to find a case where we _need_ one, because `disable_auto_if` can't be logically contorted to work. I finally found the case where they're not equivalent: when you don't want to convert to a boolean: ```meson f = get_option('feat').disable_auto_if(not foo) g = get_option('feat').enable_auto_if(foo) dep1 = dependency('foo', required : f) dep2 = dependency('foo', required : g) ```
2023-02-15preprocess: Add dependencies kwargXavier Claessens
2023-01-04document declare_dependency(object: ...)Paolo Bonzini
2022-12-21doc: Add missing include_directories kwarg to compiler.preprocess()Xavier Claessens
Fixes: #11202
2022-12-14docs: clarify the semantics of the required: kwarg everywhereEli Schwartz
Link to feature options consistently, and point out that it controls "whether" the function finds what it's trying to find. This clues people in to the fact that disabled features exist.
2022-12-06interpreter: compiler: Allow array for the prefix kwargMarvin Scholz
2022-11-30docs: clarify prog.full_path even moreEli Schwartz
The previous description update was lacking an example of why external_program cares about inter-target dependencies.
2022-11-30docs: clarify that prog.full_path has potentially valid usesEli Schwartz
Claiming that "it should literally never be used ever no matter what" is confusing and wrong -- it's definitely useful sometimes, but does result in downsides, like not tracking inter-target dependencies correctly. Ref: #10901
2022-10-23Merge pull request #10916 from xclaesse/preprocessJussi Pakkanen
Add cc.preprocess() method
2022-10-23Add doc and release notes for cc.preprocess()Xavier Claessens
2022-10-23Fix typos in docsElliott Sales de Andrade
2022-04-07docs: YAML: Add `arg_flattening: false` where requiredDaniel Mensinger
2022-04-07docs: Fix [[true]] --> `true`Daniel Mensinger
2022-03-07docs: Add docs for structured_sourcesDylan Baker
2022-03-06find_program: add a version() method to match the one for dependenciesEli Schwartz
It is often useful to check the found version of a program without checking whether you can successfully find `find_program('foo', required: false, version: '>=XXX')`
2022-01-18interpreterobjects: deprecated passing a number to configuration_data.set10Dylan Baker
This is currently allowed, and is used in at least a few projects. It was not intended to work or documented, but it does and since it is in use a full deprecation period must be used. A warning has also been added for values < 0, which have surprising behavior.