Originally name should have been set to required=True, but since then
the requirement to name CustomTargets (which compile_resources is a
wrapper around) has been dropped. As such we just need to allow the
default value of None through.
Fixes: #9698
As evidenced by the warning message immediately below this, I meant to
write "5.15" here. As is, this will enable depfile support on too-old
versions of moc.
We currently enable this only for rcc (where this really really matters)
but it can often matter for moc as well, and is just generally more
correct.
Really, this should have been added in #7451 too, but I neglected it
since the module warned about inaccurate dependencies only for rcc...
This does not convert the build side, or remove any of the checking it
does. We still need that for other callers of custom target. What we'll
do for those is add an internal interface that defaults things, then
we'll be able to have those callers do their own validation, and the
CustomTarget validation machinary can be removed.
Fixes#9096
I ran into one of these from LGTM, and it would be nice if pylint could
warn me as part of my local development process instead of waiting for
the CI to tell me.
In commit 3c4c7d0429 the qresource
variable stopped being overwritten with a mesonlib.File, which is
reasonable. However, one call site for it which relied on being a built
file did not get renamed when needed.
Make the build target use the built file.
This works for `moc_*` and `ui_files`, but it never could have worked
for `qresources` due to the implementation assuming a `str` or `File`.
To restore previous compatibility I've added `CustomTarget` where it
would have worked, but not where it would have failed, the former would
raised an exception along the lines anyway.
Fixes#9007
`qt.preprocess` dispatches to the individual methods instead of
duplicating all of the logic itself, but this means that it goes through
the type checking, and feature checking a second time. To avoid this we
need to use a private helper method instead.
Fixes#8920
For qt we already have all of the necissary checking in place. Now in
the interpreter we have the same, the intrperter does all of the
checking, then passed the arguments to the Generator initializer, which
just assigns the passed values. This is nice, neat, and clean and fixes
the layering violatino between build and interpreter.
This adds a number of missing type annotations to existing functions,
and makes a few members protected instead of public, as they were never
meant to be public
The only advantage they have is they have the interpreter in arguments,
but it's already available as self.interpreter. We should discourage
usage of the interpreter API and rely on ModuleState object instead in
the future.
This also lift the restriction that a module method cannot add build
targets, but that was not enforced for snippet methods anyway (and some
modules were doing it) and it's really loose restriction as it should
check for many other things if we wanted to make it consistent.
install_scripts used to replace @BUILD_ROOT@ and @SOURCE_ROOT@ but it
was not documented and got removed in Meson 0.58.0. gnome.gtkdoc() was
relying on that behaviour, but it has always been broken in the case the
source or build directory contains spaces.
Fix this by changing get_include_args() to substitue paths directly
which will then get escaped correctly.
Add a unit test that builds GObject documentation which is where this
issue has been spotted.
Fixes: #8744
If an invalid resource path is specified, then an uncaught python
exception occurs, and a backtrace is shown. Throw a MesonException
instead to produce a cleaner error message.
Currently the Qt Dependencies still use the old "combined" method for
dependencies with multiple ways to be found. This is problematic as it
means that `get_variable()` and friends don't work, as the dependency
can't implement any of those methods. The correct solution is to make
use of multiple Dependency instances, and a factory to tie them
together. This does that.
To handle QMake, I've leveraged the existing config-tool mechanism,
which allows us to save a good deal of code, and use well tested code
instead of rolling more of our own code.
The one thing this doesn't do, but we probably should, is expose the
macOS ExtraFrameworks directly, instead of forcing them to be found
through QMake. That is a problem for another series, and someone who
cares more about macOS than I do.
It's a method on the QtDependeny that exists purely for the consumption
of the qt module (in the form, return some stuff the module makes into
an instance variable). So put it where it actually belongs, and pass the
qt dependency into it.