| Age | Commit message (Collapse) | Author |
|
Comparing the implementation of build_subdir with
https://github.com/mesonbuild/meson/pull/12258, both of them introduced
a similar separation between srcdir and builddir. There were some
differences in the choices of srcdir vs builddir; this commit tries to
identify which are bugs in which implementation, and get the best of
both worlds.
|
|
|
|
|
|
|
|
|
|
|
|
The Rust compiler will need these to check the rust_nightly option.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This really isn't a list because it's not homogenous data, it's really
`tuple[str, str | None] | None`, but we're using list length to decide
what to do with it, and that makes for strict null issues, as an
accurate annotation would be `list[str | None]`, which would require a
lot of `is not None` checking. By using a tuple we don't need to keep
checking length, which is more expensive than null checking.
To ensure correctness I annotated some things in the VS backend
|
|
If a CustomTargetIndex is passed as an argument to a test, running meson
test (with no test glob) does not automatically build the custom_target
before running the test, because CustomTargetIndex outputs are not added
as prerequisites to the meson-test-prereq and meson-benchmark-prereq
targets.
Fixes: #14743
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
They are duplicates of what is already in compilers and have no state. Just
use compilers.
Fixes: #15082
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
No one is accessing backend.interpreter anymore, get rid of it
to avoid future temptations.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
There are a lot of spelled out unions for these types, lets reduce that
number
|
|
The two methods are identical.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
ccache has been for a long time compatible with MSVC (since 4.6)
but when using debug mode, the /Z7 flag must be passed instead of
/Zi.
See https://ccache.dev/releasenotes.html#_ccache_4_6
|
|
Compilers are not ready at the time the backend is created. Do
not look at them until generate() runs.
Fixes: 4e9fac15d ("interpreter: add backend options before validating the command line options", 2025-05-16)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
With introduction of dfd8cfbd8d9c VS compile is broken for cases where
/MANIFEST:EMBED linker flag is actually used. The fix keeps the default
creation of <EmbedManifest> but adopts the same strategy as e3db7af0ea41,
that is to scan the link flags for the embed case to decide state is emit
'true' or 'false' for EmbedManifest.
|
|
This allows linker arguments containing a space (or other special
character) to pass through to the linker correctly. For example, the spaces
in "test cases/windows/25 embed manifest" when using
meson.project_source_root().
|
|
|
|
Allow CUDA to completely override the -std arguments but not the rest.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This is an old method, that is now just a wrapper around the OptionStore
method, that doesn't add any value. It's also an option related method
attached to the CoreData instead of the OptionStore, so useless and a
layering violation.
|
|
In the preceding commit we have started to perform compiler checks for
the value of `b_sanitize`, which allows us to detect sanitizers that
aren't supported by the compiler toolchain. But we haven't yet loosened
the option itself to accept arbitrary values, so until now it's still
only possible to pass sanitizer combinations known by Meson, which is
quite restrictive.
Lift that restriction by adapting the `b_sanitize` option to become a
free-form array. Like this, users can pass whatever combination of
comma-separated sanitizers to Meson, which will then figure out whether
that combination is supported via the compiler checks. This lifts a
couple of restrictions and makes the supporting infrastructure way more
future proof.
A couple of notes regarding backwards compatibility:
- All previous values of `b_sanitize` will remain valid as the syntax
for free-form array values and valid combo choices is the same. We
also treat 'none' specially so that we know to convert it into an
empty array.
- Even though the option has been converted into a free-form array,
callers of `get_option('b_sanitize')` continue to get a string as
value. We may eventually want to introduce a kwarg to alter this
behaviour, but for now it is expected to be good enough for most use
cases.
Fixes #8283
Fixes #7761
Fixes #5154
Fixes #1582
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
|
|
|
|
There was a missing parameter in one call.
This was caused by b95e1777ddbf0f8aebb56b84a6011468088c06ec
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Charles Brunet <charles.brunet@optelgroup.com>
|
|
|
|
|
|
|
|
|
|
|
|
`func(value: dict = None)` is invalid, it must be `func(value: dict |
None = None)`, or in our older syntax: `T.Optional[T.Dict] = None`
|
|
That holds for all of these meson function: run_target, generator and
custom_target and additionally to the Windows and Gnome module.
|
|
We'll need it in a moment for get_base_compile_args -> get_assert_args.
Bug: https://github.com/mesonbuild/meson/issues/12962
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
|
|
Fixes #12265
|
|
Some backends may need to use its own target directories instead of
our default one. For this, introduce an optional argument "targetdir"
that will still use our default one when not specified.
|
|
This change fixes two usability issues with the genvslite project
generation. Unlike when using the full VS backend, under genvslite the
ProjectName property wasn't being set for generated projects. This means
projects end up being named according to the project files, which
includes suffixes like "@exe" in the solution, which is undesirable.
This change adds the ProjectName field in for genvslite projects, to
keep the naming consistent with projects under the VS backend.
Additionally, previously under genvslite, no projects were set to build
under any solution configuration by default. This is inconvenient, as
the user has to manually edit the build settings for each solution
configuration before they can compile at the solution level. There was a
note in the code to do something about this. This change enables
compilation at the solution level for the default startup project in the
solution, so the user can now just press F5 to build the solution and
run the default startup project, as they would typically expect.
|
|
Fixes #12688
|
|
Standard include paths need to be added to resolve STL and platform
headers. Additionally, compiler args need to be separated by spaces, not
semicolons, in order to be recognised.
|
|
This is a first step to make `buildtype` a true alias of `debug` and
`optimization` options.
See #10808.
Relates to:
- #11645
- #12096
- #5920
- #5814
- #8220
- #8493
- #9540
- #10487
- #12265
- #8308
- #8214
- #7194
- #11732
|
|
This could lead to subtle bugs if you happened to be building a project
that is some sort of toolchain (compiler, linker, etc)
|
|
Anywhere we have that, we also have the Environment object, which is
just wrapped by the Interpreter methods anyway. This avoids inderections
that are unnecessary.
|
|
This replaces all of the Apache blurbs at the start of each file with an
`# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing
uses to be consistent in capitalization, and to be placed above any
copyright notices.
This removes nearly 3000 lines of boilerplate from the project (only
python files), which no developer cares to look at.
SPDX is in common use, particularly in the Linux kernel, and is the
recommended format for Meson's own `project(license: )` field
|
|
Fixes #12550 .
VS automatically links CustomBuild outputs ending in .obj or .res,
but others need to be included explicitly.
|
|
EmbedManifest seems to default to true, which creates a default manifest based
on other parameters (likewise defaults) and makes it impossible to supply your
own with CREATEPROCESS_MANIFEST_RESOURCE_ID. There is value to being able to do
this and no value to the default one, so this should be disabled.
|
|
Add a common function that infers vscrt from buildtype in Compiler base
class.
|
|
Way back in Meson 0.25, support was added to `vala_args` for Files.
Strangely, this was never added to any other language, though it's been
discussed before. For type safety, it makes more sense to handle this in
the interpreter level, and pass only strings into the build IR.
This is accomplished by adding a `depend_files` field to the
`BuildTarget` class (which is not exposed to the user), and adding the
depend files into that field, while converting the arguments to relative
string paths. This ensures both the proper build dependencies happen, as
well as that the arguments are always strings.
|
|
|