Commit Graph

1978 Commits

Author SHA1 Message Date
Xavier Claessens b30cd5d2d5 Make --vsenv a readonly builtin option
We need to remember its value when reconfiguring, but the Build object
is not reused, only coredata is.

This also makes CLI more consistent by allowing `-Dvsenv=true` syntax.

Fixes: #11309
2023-03-29 09:33:41 -04:00
Xavier Claessens 748a1db1f8 doc: Fix some broken links 2023-03-28 21:46:32 +03:00
Dylan Baker be092c252e docs: replace most uses of `meson_options.txt` with `meson.options`
I've left the old release notes in place, but updated everything else to
use `meson.options`
2023-03-28 15:01:10 +03:00
Dylan Baker 4a014d1724 Add support for meson.options as a replacement for meson_options.txt
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-28 15:01:10 +03:00
Xavier Claessens 89fe81835b Allow --reconfigure and --wipe of empty builddir
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-27 17:50:48 -04:00
andy5995 c5c034525f docs: add 2022 video from PyCon US 2023-03-27 21:43:09 +03:00
Eli Schwartz a024d75e15
backends: add a new "none" backend
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-20 17:22:50 -04:00
Charles Brunet 91b88b1a76 fix meson compile with alias target
this fixes a bug introduced by #11528
2023-03-17 02:05:23 -04:00
Eli Schwartz 62c269d088
dependencies: add pybind11 custom factory
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-09 15:13:46 -05:00
Charles Brunet 47f3263165 doc: remove unexisting operators from grammar 2023-03-02 11:19:31 -05:00
Charles Brunet a0d0fb5492 mintro: redirect stdout to stderr 2023-03-02 10:10:03 -05:00
Xavier Claessens 0bb1673ec3 doc: Be more specific about warning_level option
Fixes: #11469
2023-02-28 14:00:59 -05:00
Charles Brunet c7943b993d Improve unity build documentation 2023-02-27 14:29:38 -05:00
andy5995 07076db73e docs: add Criterion 2023-02-27 14:06:40 -05:00
Charles Brunet 4a357ba6b2 documentation: there is no unary + operator 2023-02-27 13:40:16 -05:00
Eli Schwartz 9f6327c77a docs: fix bad advice to use python module to find python 2023-02-24 20:45:00 -05:00
andy5995 f9da31ce61 docs: add gcc to list of compilers with sanitize tools 2023-02-23 16:18:02 -05:00
Valeri ae5d0a6cf0 Update Vs-External.md
Fix minor typo
2023-02-23 07:59:59 -05:00
Eli Schwartz ecb32bf457
minstall: drop privileges before running rebuild_all
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-20 22:33:46 -05:00
Eli Schwartz a878c38476
minstall: rework root elevation prompt for extensibility and behavior
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-20 20:29:31 -05:00
Dylan Baker 946b66eddc docs/prebuilt: Add an example of how to use a wrap file
When using a pre-built library
2023-02-16 09:13:52 -08:00
Dylan Baker 48c9ec2fe1 docs/prebuilt: add some sanity checking to the example.
Instead of just giving a note about about how this is best practice,
actually do it.
2023-02-16 09:13:52 -08:00
Dylan Baker 295111d909 docs/prebuilt: use meson.override_dependency() 2023-02-16 09:13:52 -08:00
Dylan Baker b2473b61cc interpreter: add FeatureOption.enable_if and .disable_if
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-15 22:58:50 -05:00
Dylan Baker 3589815eb9 interpreter: add a feature.enable_auto_if
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-15 22:58:50 -05:00
Xavier Claessens d21b64487e preprocess: Add dependencies kwarg 2023-02-15 15:12:34 -05:00
Charles Brunet 04f233a80d allow install script to run in dry-run mode 2023-02-14 10:50:10 -05:00
Dudemanguy f2cb8e2ad5 add cc.has_function_attribute('vector_size') 2023-02-01 13:26:09 -08:00
andy5995 d6ff05cb9e Users.md: add @dcantrell /bsdutils 2023-01-29 08:07:34 -05:00
groveer c754f9076a
docs: Qt compile_moc() parameter error
"extra_arguments" should be "extra_args"
2023-01-20 00:27:20 -05:00
Dylan Baker 43a2404707 Deprecate passing strings to non-string options
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-20 00:18:42 -05:00
Xavier Claessens 42bfe53446 doc: Fix typo in release notes 2023-01-18 11:31:28 -05:00
Yue Yang b5b2cafcd9 Fix typo in doc of sourceset module 2023-01-18 11:10:06 -05:00
Xavier Claessens 1a0eff0054 devenv: Allow dumping into file and select a format
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-18 11:06:48 -05:00
Dylan Baker 8655287c56 docs: Add ld64.lld to linker reference table
I forgot to ask the original author to add this to the original MR
(#11243)
2023-01-10 15:12:19 -05:00
andy5995 25e73b6c9e Users.md: add slapt-get
@jaos please review
2023-01-04 19:49:36 -05:00
Luke Elliott d573db77bc clang-cl: supports /std:c++20 now.
See https://github.com/llvm/llvm-project/commit/a8f75d49
2023-01-04 09:47:13 -08:00
Paolo Bonzini 2c8c0f9586 document declare_dependency(object: ...) 2023-01-04 09:44:32 -08:00
Paolo Bonzini 8d2940024b allow passing generated objects in the "objects" keyword argument
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>
2023-01-04 09:44:32 -08:00
Eli Schwartz 0544ffabf1
add builtin option to install licenses
Unless `meson.install_dependency_manifest()` is explicitly used, this
will cause a default implied one to be installed.
2022-12-27 20:29:46 -05:00
Eli Schwartz 2fa0749175
add license_files kwarg to project
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-27 20:29:46 -05:00
Stephan Lachnit 1dce178022 docs: update IDE-integrations [skip-ci]
- change asabil.meson to vscode-meson
- remove unmaintained Meson-UI and Meson Cmake Wrapper
- remove note that Ecplise CDT support is experimental
2022-12-27 09:19:53 -05:00
Stephan Lachnit d3ad05e5e5 docs: add mmeson to IDE integrations [skip-ci] 2022-12-27 09:19:53 -05:00
Jussi Pakkanen a6d088ba3d Created release note page for 1.0.0. 2022-12-23 18:13:43 +02:00
Oliver Kraitschy c10a76fd95 Users.md: add i3 2022-12-22 18:05:12 +02:00
Amit D 2e54f772d3 Users.md: Add PostgreSQL 2022-12-19 12:28:37 -05:00
Eli Schwartz a1de195d7d
docs: update description of supported functions for feature options
We support these for a couple more things now.
2022-12-14 18:59:26 -05:00
Andreas Deininger b249470a4c Fixing typos
Convert http to https in some links
2022-12-12 12:10:37 -05:00
Jussi Pakkanen 248c1d9bd5
Merge pull request #11071 from tristan957/java-module
Java module 1.0.0 updates
2022-12-12 01:12:23 +02:00
Ewout ter Hoeven 9c1bf2bf4c DOCS: Rust-module: Remove note about unstable API
Remove the note about the unstable API of the Rust module, since it's no longer unstable as of Meson 1.0.0.
2022-12-11 16:34:00 -05:00