summaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/factory.py
AgeCommit message (Collapse)Author
2025-12-17Dependencies: Make use of the DependencyCandidate classDylan Baker
This makes the type checking more reasonable (including fixing an issue that newer mypy is pointing out to us), consolidating special cases, and improving code readability.
2025-12-17dependencies: Require 'native' be passed in kwargsDylan Baker
This simplifies a bunch of cases, and likely fixes some annoying bugs in cross compile situations where should have been passing this and weren't.
2025-12-17dependencies: stop passing "language" as a keyword argumentDylan Baker
It's allowed in the `DependencyKeywordArguments` TypeDict already, so we now have two sources of truth. Additionally, it's often populated by reading from that dict, so we're just doing useless work.
2025-10-20dependency: Use a TypedDict to describe the keyword arguments to DependencyDylan Baker
This allows us to check that all of the keyword arguments are of the correct type.
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2022-09-12dependencies: use better internal representation of factory methodsEli Schwartz
functools.partial preserves information about how the method was created, lambdas do not. Also, we just want to freeze the first argument and forward the rest anyway. This also lets us get rid of a mypy error that was being ignored.
2022-08-26Fix purely white space issues reported by flake8Alf Henrik Sauge
2022-06-10treewide: various cleanups to move imports for mypy into typechecking blocksEli Schwartz
Along the way, add __future__ annotations where lacking.
2022-05-23move various imports into TYPE_CHECKING blocks for neatnessEli Schwartz
2022-02-02openssl dependency: add cmake supportEli Schwartz
This is gross and looks terrible, but I'm not entirely sure how else to do this. And cmake is an inferior methodology, TBH, since it is effectively the same as our own builtins. However, cmake also handles some bizarre Windows library names whose provenance I'm not entirely sure of, in addition to implementing the usual excessive pattern of hardcoded search directories. So, this may be useful, at least on Windows, as a fallback. (I am not really interested in offering feature compatibility with cmake for a bunch of bizarre naming schemes that ***aren't the official cmake library names***, so if cmake allows that and people really feel they need it, all the more power to them.) Nevertheless, I believe if it got found via our system dependency class, it will always provide results which are just as functional as cmake. cmake can only find openssl installations that would otherwise be missed. This also avoids the case where users did ``` dependency('OpenSSL', modules: [...], method: 'cmake') ``` and expected it to work, since our builtin dependency supersedes the divergent case and didn't previously allow the cmake method. I don't know why they would do such a thing, but who knows... it is always possible.
2021-10-10Fix typos discovered by codespellChristian Clauss
2021-06-17add new dependency type "builtin"Eli Schwartz
For dependencies that on some systems are built into libc etc. and don't need to be separately linked. This is distinct from "system" dependencies which add linker args.
2021-06-17move base class for system dependencies into base.pyEli Schwartz
In accordance with review comments; it's small enough this seems fitting.
2021-06-14dependencies: Use a typing.NewType for Dependency.type_nameDylan Baker
This allow mypy to catch cases where we accidently assign the dependency name to the type_name, as it sees them as having different types (though at runtime they're all strings).
2021-06-09typing: Rename some variablesDaniel Mensinger
2021-06-06typing: Fully annotate dependencies.{detect,factory} + some other fixesDaniel Mensinger
2021-06-03deps: Split dependencies.baseDaniel Mensinger
Split the Factory and dependency classes out of the base.py script to improve maintainability.