aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
AgeCommit message (Collapse)AuthorFilesLines
2023-04-10Generate relnotes for 1.1.0.Jussi Pakkanen18-198/+0
2023-03-28Add support for meson.options as a replacement for meson_options.txtDylan Baker1-0/+7
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-27Allow --reconfigure and --wipe of empty builddirXavier Claessens1-0/+10
This allows to run setup command regardless whether the builddir has been configured or not previously. This is useful for example with scripts that always repeat all options. meson setup builddir --reconfigure -Dfoo=bar
2023-03-20backends: add a new "none" backendEli Schwartz1-0/+4
It can only be used for projects that don't have any rules at all, i.e. they are purely using Meson to: - configure files - run (script?) tests - install files that exist by the end of the setup stage This can be useful e.g. for Meson itself, a pure python project.
2023-03-09dependencies: add pybind11 custom factoryEli Schwartz1-0/+9
This works with pkg-config and cmake without any special support. The custom factory adds further support for config-tool, via `pybind11-config`. This is useful because the config-tool will work out of the box when pybind11 is installed, but the pkg-config and cmake files are shoved into python's site-packages, which is an unfortunate distribution model and makes it impossible to use in an out of the box manner. It's possible to manually set up the PKG_CONFIG_PATH to detect it anyway, but in case that does not happen, having the config-tool fallback is extremely useful.
2023-03-02mintro: redirect stdout to stderrCharles Brunet1-0/+5
2023-02-20minstall: drop privileges before running rebuild_allEli Schwartz1-0/+16
If the user runs `sudo meson install` this may run ninja to build everything that gets installed. This naturally happens as root also, by default, which is bad. Instead, detect root elevation tools and drop the uid/gid of the child ninja process back to the original invoking user before doing anything.
2023-02-20minstall: rework root elevation prompt for extensibility and behaviorEli Schwartz1-0/+9
There's a couple issues with the current approach: - pkexec is an unusual elevation method, the standard is sudo - it tries to elevate even in automated workflows - the user may not want to automatically rerun as root, that might be badly behaved Do some upfront checks instead, first to make sure it even makes sense to try becoming root, and then to ask the user "do you really want this". Also check for a couple common approaches to root elevation, including doas. Fixes #7345 Fixes #7809
2023-02-15interpreter: add FeatureOption.enable_if and .disable_ifDylan Baker1-0/+77
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/+4
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 Claessens1-0/+6
2023-02-14allow install script to run in dry-run modeCharles Brunet1-0/+8
2023-01-20Deprecate passing strings to non-string optionsDylan Baker1-0/+9
Currently Meson allow the following (Muon does not): ```meson option('foo', type : 'boolean', value : 'true') option('bar', type : 'integer', value : '42') ``` This is possibly a holdover from very old code, but it's a bad idea and we should stop doing it. This deprecation is the first stop on that journey.
2023-01-18doc: Fix typo in release notesXavier Claessens1-1/+1
2023-01-18devenv: Allow dumping into file and select a formatXavier Claessens1-0/+11
It is often more useful to generate shell script than dumping to stdout. It is also important to be able to select the shell format. Formats currently implemented: - sh: Basic VAR=prepend_value:$VAR - export: Same as 'sh', but also export VAR - vscode: Same as 'sh', but without substitutions because they don't seems to work. To be used in launch.json's envFile.
2023-01-04clang-cl: supports /std:c++20 now.Luke Elliott1-0/+3
See https://github.com/llvm/llvm-project/commit/a8f75d49
2023-01-04document declare_dependency(object: ...)Paolo Bonzini1-0/+5
2023-01-04allow passing generated objects in the "objects" keyword argumentPaolo Bonzini1-0/+6
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-0/+5
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.
2022-12-23Created release note page for 1.0.0.Jussi Pakkanen9-68/+0
2022-12-12Fixing typosAndreas Deininger2-2/+2
Convert http to https in some links
2022-12-11Rename java.generate_native_headers to java.native_headersTristan Partin1-0/+4
This follows the Meson naming scheme which typically leaves off a verb like generate.
2022-12-11Merge pull request #11024 from dcbaker/submit/bindgen-dependenciesJussi Pakkanen1-0/+5
Add a `dependencies` keyword argument to bindgen
2022-12-09Merge pull request #10990 from xclaesse/devenvJussi Pakkanen1-0/+15
devenv: various improvements
2022-12-07devenv: Document recent changesXavier Claessens1-0/+15
2022-12-06interpreter: compiler: Allow array for the prefix kwargMarvin Scholz1-0/+18
2022-12-05modules/rust: Add support for dependencies in bindgenDylan Baker1-0/+5
This is needed for cases where we need external C headers, which are passed to clang.
2022-12-05modules/rust: Add support for string include_directoriesDylan Baker1-0/+4
Which we support for basically every other case, but not this one.
2022-11-27Add warning_level=everythingDavid Robillard1-0/+5
Adds a new maximum warning level that is roughly equivalent to "all warnings". This adds a way to use `/Wall` with MSVC (without the previous broken warning), `-Weverything` with clang, and almost all general warnings in GCC with strictness roughly equivalent to clang's `-Weverything`. The GCC case must be implemented by meson since GCC doesn't provide a similar option. To avoid maintenance headaches for meson, this warning level is defined objectively: all warnings are included except those that require specific values or are specific to particular language revisions. This warning level is mainly intended for new code, and it is expected (nearly guaranteed) that projects will need to add some suppressions to build cleanly with it. More commonly, it's just a handy way to occasionally take a look at what warnings are present with some compiler, in case anything interesting shows up you might want to enable in general. Since the warnings enabled at this level are inherently unstable with respect to compiler versions, it is intended for use by developers and not to be set as the default.
2022-11-22compilers: remove opinionated c++ warning flagEli Schwartz1-0/+3
-Wnon-virtual-dtor is not what people think of as a standard warning flag. It was previously removed from -Wall in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16190 on the grounds that people didn't like it and were refusing to use -Wall at all because it forced this warning. Instead, it is enabled by -Weffc++ which is typically not enabled and even comes with GCC documentation warnings stating that the standard library doesn't obey it, and you might need to `grep -v` and filter out warnings. (!!!) It doesn't fit into the typical semantics of Meson's warning_level option, which usually aligns with compiler standard warning levels rather than a niche ideological warning level. It was originally added in commit 22af56e05aa9cba4740d2ff303d876bb0c3cfb2b, but without any specific rationale included, and has gone unquestioned since then -- except by the Meson users who see it, assume there is a finely crafted design behind it, and quietly opt out by rolling their own warning options with `add_project_arguments('-Wall', ...)`. Furthermore a GCC component maintainer for the C++ standard library opened a Meson bug report specially to tell us that this warning flag is a "dumb option" and "broken by design" and "doesn't warn about the right thing anyway", thus it should not be used. This is a reasonably authoritative source that maybe, just maybe, this flag... is too opinionated to force upon Meson users without recourse. It's gone beyond opinionated and into the realm of compiler vendors seem to think that the state of the language would be better if the flag did not exist at all, whether default or not. Fixes #11096
2022-11-19modules/rust: stabilizeDylan Baker1-0/+3
Mesa is using the rust module in production, so we should stabilize it.
2022-11-06Implement `in` operator on stringXavier Claessens1-0/+11
2022-11-06Generate release notes for 0.64.Jussi Pakkanen19-159/+0
2022-10-24basic support for oneapi compilersRobert Cohn1-0/+8
2022-10-24Add MASM compilerXavier Claessens1-3/+7
ml and armasm are Microsoft's Macro Assembler, part of MSVC.
2022-10-24Accept disablers in summary valuesElliott Sales de Andrade1-0/+3
They are commonly used as a replacement for a `dependency`, and not accepting them in `summary` breaks the last example in [1] when used as a value. [1] https://mesonbuild.com/Disabler.html#disabling-parts-of-the-build
2022-10-24Add yasm as fallback for nasm languageXavier Claessens1-4/+1
2022-10-24Add NASM compilerXavier Claessens1-0/+18
2022-10-23Merge pull request #10916 from xclaesse/preprocessJussi Pakkanen1-0/+14
Add cc.preprocess() method
2022-10-23Add doc and release notes for cc.preprocess()Xavier Claessens1-0/+14
2022-10-23Fix typos in docsElliott Sales de Andrade1-1/+1
2022-10-13Add b_thinlto_cache for automatically configuring incremental ThinLTOTatsuyuki Ishi1-0/+8
2022-10-11Make `meson wrap update` command update all wraps in parallelXavier Claessens1-0/+8
This moves the implementation into msubprojects because it has all the infrastructure to update wraps in parallel while keeping "meson wrap" UX.
2022-10-10Merge pull request #8941 from xclaesse/wrapdbJussi Pakkanen1-0/+6
Automatically use WrapDB fallback
2022-10-10Document and test new WrapDB auto fallbackXavier Claessens1-0/+6
2022-10-09Add BSD support to the JNISystemDependencyTristan Partin1-0/+4
Supports all BSDs that Meson currently supports. Fixes #10883
2022-10-09compilers: Add optimization=plain optionJan Tojnar1-0/+10
https://github.com/mesonbuild/meson/pull/9287 changed the `optimization=0` to pass `-O0` to the compiler. This change is reasonable by itself but unfortunately, it breaks `buildtype=plain`, which promises that ā€œno extra build flags are usedā€. `buildtype=plain` is important for distros like NixOS, which manage compiler flags for optimization and hardening themselves. Let’s introduce a new optimization level that does nothing and set it as the default for `buildtype=plain`.
2022-09-29doc: Add missing netrc release notesXavier Claessens1-0/+5
2022-09-29doc: Fix wayland release notesXavier Claessens1-2/+2
The core_only kwarg got renamed to include_core_only.