aboutsummaryrefslogtreecommitdiff
path: root/docs/yaml
AgeCommit message (Collapse)AuthorFilesLines
2023-09-19docs: fix `add_project_link_arguments` documentationBenoit Pierre1-3/+3
It should refer to `add_project_arguments`, not `add_global_arguments`.
2023-09-19Rust: Replace rust_crate_type with rust_abiXavier Claessens5-0/+40
Meson already knows if it's a shared or static library, user only need to specify the ABI (Rust or C).
2023-09-13install_{data,headers,subdir}: implement follow_symlinksArsen Arsenović3-0/+24
This permits users who rely on following symlinks to stay on the old default of following them.
2023-09-09Add support for padding zeroes in int.to_string() methodNomura1-0/+12
2023-09-09Add macro_name option to configure_fileNicholas Vinson1-0/+7
Allow macro_name to be speficied as a parameter to configure_file(). This allows C macro-style include guards to be added to configure_file()'s output when a template file is not given. This change simplifies the creation of configure files that define macros with dynamic names and want the C-style include guards.
2023-09-09clike compilers: fix cross_* functions' includeMoody Liu1-2/+13
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 Scholz1-0/+11
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-31add json output format to configure fileCharles Brunet1-1/+1
2023-08-31Doc: fix type signature for add_languages.requiredBruce Merry1-1/+1
It was listed as `bool`, but it can be a `feature` too.
2023-08-18docs: Provide example for feature.disable_auto_ifJan Janssen1-0/+14
2023-08-16Fix some random capitalization in feature.yamlTristan Partin1-3/+3
2023-08-11docs: Add more feature truth tablesJan Janssen1-10/+28
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 Claessens1-0/+11
Fixes: #5399
2023-08-07docs: add missing punctuationSebastian Crane1-1/+1
2023-08-05fixup: since: 1.1.0 -> 1.3.0Milan Hauth1-1/+1
2023-08-05compiler: Add required keyword to has_* methodsXavier Claessens1-8/+35
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-08-04Add default_options argument to find_program()Nomura1-0/+10
2023-08-02Unify message(), format() and fstring formattingXavier Claessens1-0/+4
Share a common function to convert objects to display strings for consistency. While at it, also add support for formatting user options.
2023-07-28ugh, fix typo in previous commitEli Schwartz1-1/+0
2023-07-28docs: clarify what str.split doesEli Schwartz1-2/+6
The wording was a bit confusing and misled at least one person into thinking it behaved like `str.replace('c', '')` operating on the entire line. Tweak the wording to be more precise and avoid this confusion.
2023-07-26Fix install_data() default install pathDaniele Nicolodi1-0/+2
This fixes two issues in constructing the default installation path when install_dir is not specified: - inside a subproject, install_data() would construct the destination path using the parent project name instead than the current project name, - when specifying preserve_path, install_data() would construct the destination path omitting the project name. Fixes #11910.
2023-07-20interpreter: deprecate 'jar' value of build_target(target_type)Dylan Baker1-2/+5
Jar has a very low set of overlap with other target types, including that jar sources *must* be .java, and no other target allows .java sources. As such, the difficulty in crafting a useful `build_target` invocation that allows both `jar` and anything else is high, and the usefulness is dubious. Just use `jar()` directly instead. This depends on the changes to make all of the jar() specific keyword arguments be handled by typed_kwargs so that the deprecation messages are correct and consistent.
2023-06-27Added a little more useful info to 'link_whole' documentation, describing ↵Dan Hawson1-2/+4
the use of /LINKWHOLE with MSVC and the behaviour of re-exporting symbols of individual objects in a static library.
2023-06-21Clarify `environment` docs.Paolo Borelli1-3/+2
The object is not used only for tests, but also for `custom_target` etc.
2023-06-20doc: Dictionaries are ordered since Meson 0.62.0Xavier Claessens1-1/+2
This is a side effect of requiring Python >= 3.7 which itself guarantees dictionary order. This is now a Meson language guarantee as well which is required for passing default_options as dict and is generally expected by users.
2023-06-20interpreter: Accept more types in default_options dict valuesXavier Claessens4-4/+4
2023-06-20interpreter: allow default_options and override_options as a dictDylan Baker4-8/+14
2023-06-20add str.splitlines methodMartin Dørum1-0/+22
The new splitlines method on str is intended to replace usage of fs.read('whatever').strip().split('\n'). The problem with the .strip().split() approach is that it doesn't have a way to represent empty lists (an empty string becomes a list with one empty string, not an empty list), and it doesn't handle Windows-style line endings.
2023-06-06Override find_program('meson')Tristan Partin1-0/+3
This override transparently upgrades anyone using it to this better functionality. Fixes #8511
2023-05-24repair install_mode support for uid/gid effectively everywhereEli Schwartz7-0/+21
We silently dropped all integer values to install_mode since the original implementation of doing this in KwargInfo, in commit 596c8d4af50d0e5a25ee0ee1e177e46b6c7ad22e. This happened because install_mode is supposed to convert False (exactly) to None, and otherwise pass all arguments in place. But a generator is homogeneous and attempting to do this correctly produced a mypy error that FileMode arguments were allowed to be ints -- well of course they are -- so that resulted in the convertor... treating ints like False instead, to make mypy happy. Fixes #11538
2023-05-23docs: Fix some typos in feature option examplesNirbheek Chauhan1-2/+2
2023-04-21rust: Add new `rust_dependency_map` target configurationSebastian Dröge1-0/+10
This allows changing the crate name with which a library ends up being available inside the Rust code, similar to cargo's dependency renaming feature or `extern crate foo as bar` inside Rust code.
2023-04-20extra_files keyword in declare_dependency()Charles Brunet1-0/+7
2023-04-11fix various spelling issuesJosh Soref7-9/+9
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-11Change "can not" to "cannot" throughout projectHiPhish1-1/+1
The word "cannot" expresses inability to do something whereas "can not" expresses the ability to refrain from doing something.
2023-03-28doc: Fix some broken linksXavier Claessens1-2/+2
2023-03-28Add support for meson.options as a replacement for meson_options.txtDylan Baker2-3/+3
We will still try to load `meson_options.txt` if `meson.options` doesn't exist. Because there are some advantages to using `meson.options` even with older versions of meson (such as better text editor handling) we will not warn about the existence of a `meson.options` file if a `meson_options.txt` file or symlink also exists. The name `meson.options` was picked instead of alternative proposals, such as `meson_options.build` for a couple of reasons: 1. meson.options is shorter 2. While the syntax is the same, only the `option()` function may be called in meson.options, while, it may not be called in meson.build 3. While the two files share a syntax and elementary types (strings, arrays, etc), they have different purposes: `meson.build` declares build targets, `meson.options` declares options. This is similar to the difference between C's `.c` and `.h` extensions. As an implementation detail `Interpreter.option_file` has been removed, as it is used exactly once, in the `project()` call to read the options, and we can just calculate it there and not store it. Fixes: #11176
2023-03-01docs: document default_options behaviourJohn Levon1-0/+5
As discussed in issue #8037, using `c_args` in `project()` leads to `CFLAGS` not being respected, which is a common mistake. Document this and suggest using `add_project_arguments()` instead. Signed-off-by: John Levon <levon@movementarian.org>
2023-03-01docs: fix a small typoJohn Levon1-1/+1
s/Accecpts/Accepts/ Signed-off-by: John Levon <levon@movementarian.org>
2023-02-20interpreter/mesonmain: Add build_options methodL. E. Segovia1-0/+15
This method allows meson.build to introspect on the changed options. It works by merely exposing the same set of data that is logged by MesonApp._generate. Fixes #10898
2023-02-15interpreter: add FeatureOption.enable_if and .disable_ifDylan Baker1-0/+60
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 Baker1-0/+17
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-15docs: add description of license_files kwargEli Schwartz1-0/+16
Added in commit 2fa074917597fea0cf3332c6620d3414034825e4 but I forgot to document it.
2023-02-15preprocess: Add dependencies kwargXavier Claessens1-0/+4
2023-02-14allow install script to run in dry-run modeCharles Brunet1-0/+12
2023-02-10docs: Add cython to the languages accepted by project()Daniele Nicolodi1-2/+3
Fixes #11373.
2023-01-04document declare_dependency(object: ...)Paolo Bonzini2-2/+9
2023-01-04allow passing generated objects in the "objects" keyword argumentPaolo Bonzini1-2/+5
Generated objects can already be passed in the "objects" keyword argument as long as you go through an extract_objects() indirection. Allow the same even directly, since that is more intuitive than having to add them to "sources". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-12-27add builtin option to install licensesEli Schwartz1-0/+4
Unless `meson.install_dependency_manifest()` is explicitly used, this will cause a default implied one to be installed.
2022-12-27add license_files kwarg to projectEli Schwartz1-2/+10
Hook this up to installed dependency manifests. This is often needed above and beyond just an SPDX string -- e.g. many licenses have custom copyright lines.