aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies
AgeCommit message (Collapse)AuthorFilesLines
2023-09-23openmp: add 5.1/5.2, fixes openmp with llvm v17Christoph Reiter1-0/+2
llvm v17 defaults to 5.1 and without this meson fails to find openmp: 'ERROR: Dependency "openmp" not found, tried system' Add 5.2 as well while at it.
2023-09-22ZlibSystemDependency: pass libtype to clib_compiler.find_libraryAlan Coopersmith1-1/+1
Makes it stop reporting that it found a static zlib on Solaris which does not ship a static library file for libz, and thus allows "test cases/rust/13 external c dependencies" to pass. Fixes #10906
2023-09-18pkgconfig: Use ImmutableListProtocol[str] for cached listsXavier Claessens1-9/+10
This ensures that we are not modifying lists from lru cache.
2023-09-18pkgconfig: Set PKG_CONFIG in env for devenv and g-ir-scannerXavier Claessens1-14/+42
2023-09-18pkgconfig: Deprecate "pkgconfig" in favor of "pkg-config" in [binaries]Xavier Claessens1-1/+1
2023-09-18pkgconfig: Restore logging of pkg-config versionXavier Claessens1-14/+12
While at it, make more methods private by storing the version found on the instance. That avoids having to call check_pkgconfig() as static method from unittests.
2023-09-18pkgconfig: Use lru_cache instead of caching command linesXavier Claessens1-19/+9
2023-09-18pkgconfig: Cache the implementation instanceXavier Claessens1-42/+31
2023-09-18Remove get_configtool_variable()Xavier Claessens2-30/+5
This also makes it more consistent with get_pkgconfig_variable() which always return empty value instead of failing when the variable does not exist. Linking that to self.required makes no sense and was never documented any way.
2023-09-18Remove get_pkgconfig_variable()Xavier Claessens7-45/+28
Make sure that pkgconfig_define is a pair of strings and not a list with more than 2 strings.
2023-09-12fix bug with openssl when cmake is missingCharles Brunet2-4/+20
Fixes #12098 DependencyFactory was returning a lambda, but it has no log_tried() function
2023-09-08dependencies: fix crash in Qt if private_headers dir not foundEli Schwartz1-1/+1
You cannot listdir() a directory that doesn't exist. This header directory may not exist if suitable devel packages in distros with split devel packages, aren't installed. In theory we could raise a suitable error here. But it would be inconsistent -- we don't otherwise validate that the Qt include directories exist, usually just assuming they do because the dependency was found. And this is niche code inside a non-default special kwarg. At least for pkg-config, it's probably a bug in the distro if pkg-config files exist but the headers don't. The qmake status is less clear. Avoiding a crash means that at the very least, if those headers are in fact directly used by the project, an obvious compiler error occurs instead of a noisy meson traceback. Fixes #12214
2023-09-08Override config-tool get_variable args for qmakeNirbheek Chauhan2-1/+7
2023-08-23Use `cudart_static` by default in dependency('cuda')David Seifert1-1/+3
* Without this, using nvcc as the sole driver vs dependency('cuda') and host compiler driver yields differently linked binaries.
2023-08-23Fix completely broken support for `static: true` with dependency('cuda')David Seifert1-2/+10
2023-08-18consistently use Literal annotation from typing_extensionsEli Schwartz1-1/+3
This is our standard annotation policy, and makes mypy safe under python 3.7
2023-08-14Python: Add 'limited_api' kwarg to extension_moduleAndrew McNulty1-4/+8
This commit adds a new keyword arg to extension_module() that enables a user to target the Python Limited API, declaring the version of the limited API that they wish to target. Two new unittests have been added to test this functionality.
2023-08-11treewide: automatic rewriting of all comment-style type annotationsEli Schwartz5-25/+25
Performed using https://github.com/ilevkivskyi/com2ann This has no actual effect on the codebase as type checkers (still) support both and negligible effect on runtime performance since __future__ annotations ameliorates that. Technically, the bytecode would be bigger for non function-local annotations, of which we have many either way. So if it doesn't really matter, why do a large-scale refactor? Simple: because people keep wanting to, but it's getting nickle-and-dimed. If we're going to do this we might as well do it consistently in one shot, using tooling that guarantees repeatability and correctness. Repeat with: ``` com2ann mesonbuild/ ```
2023-08-11remove useless type annotationsEli Schwartz2-3/+3
These annotations all had a default initializer of the correct type, or a parent class annotation.
2023-08-08interpreter|dependencies: Fix issues spotted by mypyDylan Baker1-5/+4
Which is mostly that other annotations are wrong.
2023-08-08Detect version for Vulkan system dependencyLucas Alber1-5/+29
2023-08-03PkgConfigDependency: Move CLI handling into its own abstractionXavier Claessens3-162/+226
This makes the code cleaner and will allow to have other implementations in the future.
2023-07-23hdf5: remove C sub-dependency for config toolGeorge Sedov1-7/+0
the config tool provided by HDF5 correctly links to the C libraries without explicit sub-dependancy
2023-07-23hdf5: fix wrong env values for config toolGeorge Sedov1-2/+5
2023-07-19fix implicit_reexport issues and enforce them going forwardEli Schwartz6-11/+13
This detects cases where module A imports a function from B, and C imports that same function from A instead of B. It's not part of the API contract of A, and causes innocent refactoring to break things.
2023-06-26dependencies: switch the delayed-import mechanism for custom dependenciesEli Schwartz14-69/+114
Simply store the module it is expected to be found in. That module then appends to the packages dict, which guarantees mypy can verify that it's got the right type -- there is no casting needed.
2023-06-26dependencies: defer importing a custom dependency until it is usedEli Schwartz2-81/+66
This lessens the amount of code imported at Meson startup by mapping each dependency to a dictionary entry and using a programmable import to dynamically return it. Minus 16 files and 6399 lines of code imported at startup.
2023-06-26dependencies: delay often-unused importsEli Schwartz1-4/+4
We expose detect.py as the mesonbuild.dependencies entrypoint and import it upfront everywhere. But unless the `dependency()` function is actually invoked, we don't need *any* of the private implementations for this. Avoid doing so until, as part of actual dependency lookup, we attempt that specific dependency method. This avoids importing big modules if `method:` is specified, and in most cases hopefully pkg-config works and we can avoid importing the cmake implementation particularly. Actually avoiding most of these imports requires more refactoring. But even so, the garden path no longer needs to import the dub dependency impl.
2023-06-26dependencies: Don't Repeat Yourself when it comes to lookup methodsEli Schwartz1-24/+17
We need to extend the candidates the same way per method, but we handle each method twice: once in explicit method checks, and once for auto. We can just handle auto as a special list of methods, though.
2023-06-26dependencies: move dub to a hidden package internal detailEli Schwartz1-2/+0
Do not import it and expose it at the package scope, it's never used elsewhere except inside the dub module.
2023-06-14WIP: refactor loggable popen calls for consistencyEli Schwartz2-17/+5
2023-06-08dependencies/llvm: strip default include dirsKarol Herbst2-2/+14
Fixes an issue with rust.bindgen if a cmake LLVM dependency with the system include_type is getting used as a dependency.
2023-06-07dependencies: add more logging to configtoolEli Schwartz1-0/+5
When retrieving variables from the tool, log some debug output the same way that pkg-config does.
2023-06-08dependencies/qt: add support for Qt frameworks referencing includes in ↵Matthew Waters1-2/+5
include directory e.g. QtQml with Qt 6.4.0 referencing QtQmlIntegration is one such example
2023-06-01python: Use detect.find_external_dependency() for log consistencyXavier Claessens1-2/+3
py.find_installation().dependency() was not logging whether it is found or not. Use find_external_dependency() for consistency.
2023-05-23qt: Allow specifying separate tools for qt4/5/6Nirbheek Chauhan1-1/+1
Currently you can only use one of qt4, qt5, qt6 in a single project when using a machine file because the config-tool lookup for qt only looks at `qmake` in the machine files, instead of looking up the binary names directly. Allow specifying `qmake` `qmake4` `qmake5` and `qmake6`. This is necessary for gstreamer, which can build separate qt5 and qt6 plugins that are distributed as static libraries, so the user can pick which one to use.
2023-05-18Check dub version (#11794)Remi Thebault1-28/+58
* DubDependency._check_dub returns the version * check for compatible Dub version Dub versions starting at 1.32 have a new cache structure into which Meson doesn't know where to find compatible artifacts * skipping D tests involving Dub * refactor _check_dub makes mypy happier * make linters happy * localize some logic
2023-05-13Make `dependency('foo', static: true, method: 'cmake') link staticallyVolker Weißmann2-0/+5
Fixes #1709
2023-05-05Fix building python extensions on win-arm64Radek Bartoň1-17/+8
2023-05-05Python module: emit warning for debug buildtypes with MSVC and no debug PythonRalf Gommers1-1/+24
CPython adds a hard to avoid hardcoded link flag to look for a debug libpython. This results in a very puzzling error, so emit a warning with a clear message. Note that pybind11 has a workaround for this, which undefines `_DEBUG`. So users who use only pybind11 can use non-release buildtypes, but they won't get debug symbols on Windows unless they have a debug build.
2023-05-03dependencies: allow config-tool to fallback to default program namesEli Schwartz2-1/+5
If the dependency permits it, we can just do a PATH search instead of mandating that it be listed in the cross file. This is useful for the limited case where a specific dependency is known to be compatible with any machine choice. Mark the pybind11 dependency as supporting this. It's a valid choice because pybind11 is a header-only C++ library.
2023-04-24dependencies: allow to fallback on CMake to find the SDL2 libraryMatthieu Bouron1-1/+2
On Windows, the SDL2 library is generally provided with only CMake config files. This commit allows meson to fallback on CMake as a last resort to find the SDL2 library.
2023-04-23fix python.version() not working in some casesCharles Brunet1-0/+1
import('python').find_installation('python').version() causes exception because of a missing initialization, when `find_installation()` receives a name or a path.
2023-04-20intro: add more details to generated json filesCharles Brunet1-1/+1
This will help with the writing of tools to generate VisualStudio project and solution files, and possibly for other IDEs as well. - Used compilers a about `host`, `build` and `target` machines arere listed in `intro-compilers.json` - Informations lister in `intro-machines.json` - `intro-dependencies.json` now includes internal dependencies, and relations between dependencies. - `intro-targets.json` now includes dependencies, `vs_module_defs`, `win_subsystem`, and linker parameters.
2023-04-20extra_files keyword in declare_dependency()Charles Brunet1-2/+11
2023-04-11fix various spelling issuesJosh Soref6-9/+9
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-03-28python dependency: avoid redefinition warnings for MS_WIN64Eli Schwartz1-1/+1
pyconfig.h defines it in limited cases, but as empty, rather than as "1" which is what command-line defines generally do. Explicitly define it as a compatible definition so the compiler does not log a warning that the value has changed. Fixes #11592
2023-03-24Add a system method for obtaining GL dependency on Linux OSHelen Ginn1-1/+9
2023-03-16prevent lib prefix warning from pkg-configCharles Brunet1-1/+2
2023-03-09dependencies: add pybind11 custom factoryEli Schwartz2-1/+25
This works with pkg-config and cmake without any special support. The custom factory adds further support for config-tool, via `pybind11-config`. This is useful because the config-tool will work out of the box when pybind11 is installed, but the pkg-config and cmake files are shoved into python's site-packages, which is an unfortunate distribution model and makes it impossible to use in an out of the box manner. It's possible to manually set up the PKG_CONFIG_PATH to detect it anyway, but in case that does not happen, having the config-tool fallback is extremely useful.