aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/qt.py
AgeCommit message (Collapse)AuthorFilesLines
2022-04-14qt module: move comment to the correct location after refactoringEli Schwartz1-2/+2
In commit f291b637b13ba32e20d1081906e68780d2a5ae5a the tools were moved around but a comment got forgotten. Now, in order to be meaningful and remind us of anything, it needs to be in a different location.
2022-04-12qt module: also prefer the changed name scheme for the toolsEli Schwartz1-1/+3
Although Qt6 has decided these are "internal" commands and should never be run directly, so they don't get symlinked to /usr/bin at all, and are only available in the qt_dep.bindir anyway. But, the general naming pattern should be followed on principle.
2022-04-12Add support for Qt 6.1+John Lindgren1-0/+2
Qt 6.1 moved the location of some binaries from QT_HOST_BINS to QT_HOST_LIBEXECS as noted in the changelog: c515ee178f Move build tools to libexec instead of the bin dir - Tools that are called by the build system and are unlikely to be called by the user are now installed to the libexec directory. https://code.qt.io/cgit/qt/qtreleasenotes.git/tree/qt/6.1.0/release-note.txt It's possible to help the 'qt' module find the tools by adding Qt's libexec directory to the PATH environment variable, but this manual workaround is not ideal. To compensate, meson now needs to look for moc, rcc, uic, etc. in QT_HOST_LIBEXECS as well as QT_HOST_BINS. Co-authored-by: Stefan Hajnoczi <stefanha@jammr.net>
2022-03-29move a bunch of imports into TYPE_CHECKING blocksEli Schwartz1-2/+5
These are only used for type checking, so don't bother importing them at runtime. Generally add future annotations at the same time, to make sure that existing uses of these imports don't need to be quoted.
2022-03-29Pass environment down to base Target classXavier Claessens1-0/+3
2022-03-07treewide: string-quote the first argument to T.castEli Schwartz1-1/+1
Using future annotations, type annotations become strings at runtime and don't impact performance. This is not possible to do with T.cast though, because it is a function argument instead of an annotation. Quote the type argument everywhere in order to have the same effect as future annotations. This also allows linters to better detect in some cases that a given import is typing-only.
2022-01-28build: replace kwargs in CustomTarget initializerDylan Baker1-26/+33
Because we don't want to pass the Interpreter kwargs into the build layer. This turned out to be a mega commit, as there's really on elegant way to make this change in an incremental way. On the nice side, mypy made this change super easy, as nearly all of the calls to `CustomTarget` are fully type checked! It also turns out that we're not handling install_tags in custom_target correctly, since we're not converting the boolean values into Optional values!
2021-12-05modules/qt: compeil_resources allow name to be unsetDylan Baker1-1/+1
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
2021-11-22qt module: fix stupid copy-paste errorEli Schwartz1-1/+1
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.
2021-11-20add location nodes to some Feature callsEli Schwartz1-6/+11
2021-11-13qt module: add depfile support to moc as wellEli Schwartz1-1/+11
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...
2021-10-27fix various flake8 whitespace errorsEli Schwartz1-1/+1
2021-10-10Fix typos discovered by codespellChristian Clauss1-3/+3
2021-09-30interpreter: Use typed_kwargs for func_custom_targetDylan Baker1-8/+8
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
2021-09-24pylint: check for duplicate importsDylan Baker1-2/+1
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.
2021-09-10qt module: consolidate on one list of binsEli Schwartz1-25/+25
2021-09-10qt module: fix regression in building translations via qresourceEli Schwartz1-1/+1
In commit 3c4c7d042932c23a8ea24d85f24cd290d0a5ea13 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.
2021-09-10qt module: correctly register a found tool and stop looking for itEli Schwartz1-3/+1
Regression in commit d7ac2f10655433989e5e17867b6c8ef428fd39e8 since self.{tool_name} is not how it used to be tracked, and the "found" dictionary is a legacy of the old location.
2021-08-27interpreter: fix cases of `KwargInfo(..., T, default=None)`Dylan Baker1-2/+3
The correct way to mark these is `KwargInfo(..., (T, type(None)))`. There's also a few cases of `(T, None)` which is invalid, as `None` isn't a type
2021-08-18modules/qt: Allow using generated sources for compile_translations ts_filesDylan Baker1-4/+11
2021-08-18modules/qt: Allow Generated sources in compile_resourcesDylan Baker1-28/+48
2021-08-18modules/qt: allow passing generated targets to compile_uiDylan Baker1-2/+9
2021-08-18modules/qt: Allow generated sources for arguemnts to compile_mocDylan Baker1-4/+18
2021-08-17Add install tagsXavier Claessens1-0/+1
Fixes: #7007.
2021-07-23qt: Allow CustomTargets for qt.preprocess source argumentsDylan Baker1-11/+11
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
2021-06-27modules/qt: use _impl private methods to avoid incorrect FeatureNewDylan Baker1-11/+28
`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
2021-06-18holders: Fix the remaining code to respect the holder changesDaniel Mensinger1-37/+36
2021-06-18modules/qt: use append rather than extend in preprocessDylan Baker1-3/+3
Because that's what we need, of course
2021-06-18modules/qt: allow string values for include_directoriesDylan Baker1-4/+4
This should have been supported before, but wasn't.
2021-06-15modules/qt: sort and clean up dependenciesDylan Baker1-8/+9
2021-06-15modules/qt: Return GeneratedListHolder instead of GeneratedListDylan Baker1-2/+2
This really shouldn't be necissary, but fixing the typing annotations of ModuleReturnValue is much harder than just returning the Holder directly.
2021-06-15interpreterobjects|build: use typed_kwargs for generator.processDylan Baker1-3/+3
2021-06-15build: Pass name of generator to initializerDylan Baker1-6/+11
It's really a property of the Generator what name to use, not something that should be passed to each call to process files.
2021-06-15interpreter|build: Do Generator keyword argument checking in the interpreterDylan Baker1-13/+9
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.
2021-06-15interpreter|build: Pass just the executable down to GeneratorDylan Baker1-3/+3
This requires that the interpreter has done the validation, which it now does at all callsites. This simplifies the Generator initializer.
2021-06-15modues/qt: Make use of typed_kwargs since/deprecation abiltiyDylan Baker1-15/+7
2021-06-15modules/qt: fix remaining typing issues and add to run_mypyDylan Baker1-13/+15
This just ignores the fact taht Generator is unchecked. Generator needs some real love in terms of type checking.
2021-06-15modules/qt: use type checking and annotations for compile_translationsDylan Baker1-13/+34
2021-06-15modules/qt: fully annotate and check qt.has_toolsDylan Baker1-4/+18
2021-06-15modules/qt: Make use of the default=[] availabilityDylan Baker1-29/+44
2021-06-15modules/qt: Type anotations and cleanupsDylan Baker1-17/+30
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
2021-06-15modules/qt: have pre-process dispatch to moc_compileDylan Baker1-31/+10
for ode sharing and simplicity
2021-06-15modules/qt: Add a compile_moc methodDylan Baker1-1/+59
This method only compiles moc resources, nothing else
2021-06-15modules/qt: use the compile_ui method inside the preprocess methodDylan Baker1-8/+2
for code deduplication
2021-06-15modules/qt: Add a compile_ui methodDylan Baker1-0/+33
Which is the same functionality split out of preprocess
2021-06-15modules/qt: Dispatch the preprocess method to the compile_resources methodDylan Baker1-30/+5
Which removes code duplication and makes our testing better
2021-06-15modules/qt: Add a `compile_resources` methodDylan Baker1-14/+98
This is a separate method for just handling qrc resources.
2021-06-15modules/qt: Deprecated the preprocess sources keyword argumentDylan Baker1-2/+3
2021-06-15modules/qt: Deprecated the *sources variadic argument to preproccessDylan Baker1-2/+5
It's confusing, and it's a duplicate of the `sources` keyword argument, which has always existed.
2021-06-03deps: Split dependencies.baseDaniel Mensinger1-1/+1
Split the Factory and dependency classes out of the base.py script to improve maintainability.