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.
Adds a howto section describing how to put files in a separate build
target and override the unity build setting, and why you might want to
do this.
Closes: #13031
We have seen a number of bugs from people confused by warning that the
need both a C and C++ compiler to use the CMake method. This attempts
to provide a more helpful error message.
When a user writes `import'foo')`, Meson checks the
`mesonbuild/modules/` directory for a package called `foo.py`, and
attempts to import it. We don't want to expose any implementation detail
packages like `_qt.py`, so if someone write `import('_qt')`, we should
immediately give a "doesn't exist" error.
Since it's an implementation detail, and shouldn't be exposed. This also
helps give better error messages when a user writes `import('qt')`,
since otherwise you get an error about `qt doesn't have an initialize
method`, and now you get `qt module doesn't exist`.
Some tests for `gnome.mkenums_simple` were only compiled, but not run.
Most bugs will be caught by compilation alone, but it's better to run
the generated binary too in case there are runtime issues in the
generated code.
The naming of all enum tests is now unified as well.
Commit 83facb3959 switched to using
`textwrap.dedent` for the code templates for `gnome.mkenums_simple`.
That changed indentation, however, making the generated code harder to
understand.
We improve this by properly indenting the multiline strings before
dedenting them. For optional parameters `decl_decorator` and
`header_prefix`, we add a newline if they are set to keep separation
between generated code blocks.
The `AstVisitor` intentionally ignores whitespaces and symbols,
as they are not useful for tne interpreter. However, when formatting a
build file, we need them. This commit introduces a `FullAstVisitor` that
visits every Nodes, including whitespaces and symbols.
This incorrectly warns that `compiler.run()` is new in 1.5.0 for
Fortran, but that works fine for older versions (noted with 1.2.3). This
makes sense, as FortranCompiler inherits CLikeCompiler
If -L flags get into CLikeCompiler::build_wrapper_args, they will be
correctly detected and the /LINK flag added to the list. However,
CompilerArgs::__iadd__ will reorder them to the front, thinking they're
GNU-style flags, and this will cause MSVC to ignore them after
conversion.
The fix is twofold:
1. Convert all the linker args into their compiler form, making sure the
/LINK argument is dropped (see 2)
2. Insert /LINK into extra_args if not already present
3. Execute in situ the unix_to_native replacement, ensuring no further
reordering occurs.
Fixes#11113
When C6000 support was added in #12246, TI compilers were given the correct version argument.
This broke the previous check which relied on an error being thrown by the compiler.
This somewhat aligns "darwin" (Mach-O) with how ELF RPATHs are treated.
Instead of blindly removing all RPATHs, only remove the ones that are in
the rpath_dirs_to_remove set. This way, RPATHs that were added by the
toolchain or user are left untouched.
It is important not to remove RPATHs as they may be vital for the
executable at runtime. Issues #12045 and #12288 are examples of this.
Issue: https://github.com/mesonbuild/meson/issues/12045
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
There's a known ninja bug
(https://github.com/ninja-build/ninja/issues/1952) that running this
with dyndeps will result in Ninja deleting implicit outputs from the
dyndeps, leading to pointless rebuilds. For reference, this is what
CMake does as well.
This basically existed for an assert which we don't need, as mypy would
catch that issue for us anyway. Removing the function entirely has some
small performance advantages
We already have to decide whether to scan a file at configure time, so
we don't want to have to do it again at compile time, every time the
depscan rule is run. We can do this by saving and passing the language
to use in the pickle, so depscan doesn't have to re-calculate it. As an
added bonus, this removes an import from depscan
We don't need to write and pass two separate files to the depscanner,
I've used the pickle because the pickle serializer/deserializer should
be faster than JSON, thought I haven't tested.