With the current logic passing `--debug` will actually be parsed as
`-Ddebug=false`, which is absolutely not what is expected.
There is no case in which the presence of a boolean option in `--foo`
form will mean 'I want feature foo disabled', regardless of the
*default* value of that option.
Also includes a test.
Closes https://github.com/mesonbuild/meson/issues/4686
The previous code was assuming that options do not depend on each
other, and that you can set defaults using `dict.setdefault()`. This
is not true for `buildtype` + `optimization`/`debug`, so we add
defaults + overrides in the right order and use the options parsing
code later to compute the values.
Includes a test.
Closes https://github.com/mesonbuild/meson/issues/6752
This ensures that options are always parsed in the order in which they
were specified on the command-line, even with Python 3.5, and
non-CPython implementations compatible with CPython 3.5 and 3.6.
Closes https://github.com/mesonbuild/meson/issues/6742
[why]
Sometimes one want to set the 'Conflicts:' field in .pc files.
This is possible by using the 'conflicts' keyword argument in the
pkgconfig module. The feature is not documented on mesonbuild.org,
though.
But a warning is issued:
WARNING: Passed invalid keyword argument "conflicts".
WARNING: This will become a hard error in the future.
History:
It has been added along with kwarg 'url' with commit
309041918 pkgconfig: Add missing 'URL' and 'Conflicts' entries
Later the kwargs check has been introduced with
80d665e8d Converted some modules.
but both 'url' and 'conflicts' were missing.
With commit
2acf737b pkgconfig: Document url keyword
the 'url' kwarg has been added to the checks, but not 'conflicts'.
[how]
Add 'conflicts' to the allowed kwargs.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This change made `5 dependency versions` unit test fail because now once
a subproject has been configured, the fallback variable is checked to be
consistent. So it has to use new subproject because 'somesub' was
already configured by previous tests.
Similar to meson.override_find_program() but overrides the result of the
dependency() function.
Also ensure that dependency() always returns the same result when
looking for the same dependency, this fixes cases where parts of the
project could be using a system library and other parts use the library
provided by a subproject.
Compiler is invariant, in other words Compiler and only Compiler can
fulfull it, it's derived classes cannot be used. CompilerType is
covariant, that is Compiler and any derived class can fulfill it. This
fixes a number of issues in the boost module.
This makes the typing annotations basically impossible to get right, but
if we only have one key then it's easy. Fortunately python provides
comprehensions, so we don't even need the ability to pass multiple keys,
we can just [extract_as_list(kwargs, c) for c in ('a', 'b', 'c')] and
get the same result.
These are basically doing what mlog.log(..., once=True) does, so lets
just use that. The once argument to mlog is newer, so these probably
should have been changed already.
listify shouldn't be unholdering, it's a function to turn scalar values
into lists, or flatten lists. Having a separate function is clearer,
easier to understand, and can be run recursively if necessary.
The old logic was completely broken, and didn't even assert that the
specified section was found at all. The CPU families test was broken
because of this. Luckily, the table didn't go out of sync with the
code.
It now also doesn't assume that each section has only one table. This
fixes the test now that we document the buildtype/optimization/debug
mapping in a second table inside the `Universal options` section.
Otherwise you have to hunt through the source code. Specifically, this
is defined in `mesonbuild/coredata.py`: `set_buildtype_from_others()`
and `set_others_from_buildtype()`
As any child of BuildTargetHolder might need the name of the object,
provides a method to get object name.
This is useful in gst-build to display the plugin name and not
the filename.