I would have prefered to do these seperatately, but they are combined in
some cases, so it was much easier to convert them together.
this eliminates the builtins_per_machine dict, as it's duplicated with
the OptionKey's machine parameter.
It's a bit odd we have a test for an external project that's not even in
the meson organization. Regardless, the json file was recently replaced
by a cson file. There is an coffee-script-notation parser in pypi,
but I couldn't get it to work. Just delete the test
As a necessity nix adds a bunch of rpaths to files, this is unavoidable
do to the way nix package management works. Meson doesn't expect this
however, and fails all rpath tests. To correct this we just ignore any
rpath entries that start with `/nix`.
env.detect_<lang>_compiler only checks that there is a binary called
whatever that returns a version. There are several cases where the found
binary doesn't work:
1) gcc for ojbc[pp], when support isn't compiled in.
2) the compiler is broken (rust in appveyor somtimes)
Because of that we need to call compiler.sanity_check() as well, and if
we get an EnvironmentException from that skip the language
Also, instead of having a long line of try: ... except: pass, roll all
of the checking up into a loop using getattr(), which is less code and
makes adding a new language easier
The order of elements in sets cannot be relied upon, because the hash
values are randomized by Python. Whenever sets are converted to lists
we need to keep their order stable, or random changes in the command line
cause ninja to rebuild a lot of files unnecessarily. To stabilize them,
use either sort or OrderedSet. Sorting is not always applicable, but it
can be faster because it's done in C and it can produce slightly nicer
output.
So that editors that can fold code (vim, vscode, etc) can correctly fold
functions, instead of getting confused by code that doesn't follow the
current indention. Also, it makes the code easier to read.
Right now sub-sub projects are not correctly registered, because we
don't have a way to pass up past the first level of subproject. This
patch changes that by making the build_Def_files as defined in the
Interpreter initializer accurate for translated dependencies, ie, cmake
dependencies won't define a dependency on a non-existent meson.build.
This means that it can always add the subi.build_def_files because they
are always accurate.
This fixes a regression introduced by
https://github.com/mesonbuild/meson/pull/7488.
InternalDependency's ext_deps previously where simply ignored, but that
PR has effect to add many more public Requires in generated pc files.
This is consistent with c_args in machine file overriding CFLAGS from
env. This also spotted an issue where in a native build this resulted
in pkg_config_path being /bar instead of /foo:
`-Dpkg_config_path=/foo -Dbuild.pkg_config_path=/bar`
Fixes: #7573
wraps from subprojects are now merged into the list of wraps from main
project, so they can be used to download dependencies of dependencies
instead of having to promote wraps manually. If multiple projects
provides the same wrap file, the first one to be configured wins.
This also fix usage of sub-subproject that don't have wrap files. We can
now configure B when its source tree is at
`subprojects/A/subprojects/B/`. This has the implication that we cannot
assume that subproject "foo" is at `self.subproject_dir / 'foo'` any
more.
Currently if you change the `choices` field in the meson_options.txt
file, no update will be done until `meson setup --wipe` is called. Now
if the choices change then the options will be properly merged.
If the currently select value is still valid it is guaranteed to be
kept, if it is now invalid the new default value will be used and a
warning will be printed.
Fixes#7386
`pathlib.Path.glob()` also returns directories that match source
filenames (i.e. a directory named `test.h/`), but `clang-format` and
`clang-tidy` fail when handed a directory. We manually skip calling
`clang-format` and `clang-tidy` on those directories.
This is required to make the various keys in the [user options] section
work the same as they do in the meson_options.txt file, where we don't
have any rules about case sensitivity.
There is some risk here. Someone may be relying on this lower by default
behavior, and this could break their machine files.
Fixes#7731
It was done to include them in `meson subprojects foreach` without
--types argument, but it's better to special case missing --types and
include wraps that have type=None too. It was a bad idea because that
was messing them in `meson subprojects update`, now they are ignored by
that command.