aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies
AgeCommit message (Collapse)AuthorFilesLines
2021-10-27fix various flake8 whitespace errorsEli Schwartz2-2/+2
2021-10-26dep.name(): return dependency name even if dependency is not foundThomas Heijligen2-3/+3
The dep.name() function schould always return the name of the dependency as documented. No matter if it was found or not. https://mesonbuild.com/Reference-manual_returned_dep.html#depfound
2021-10-24cmake: Add support for the Linux CMake registry (fixes #9418)Daniel Mensinger1-0/+6
2021-10-10pkg-config: do not ever successfully detect Strawberry Perl.Eli Schwartz1-0/+4
This is broken and terrible and thus completely unusable. Don't torture users by finding pkg-config on Windows, thus permitting the pkg-config lookup of several dependencies that do not actually work -- which then fails at build time. This also breaks CI for the wrapdb, because Strawberry Perl is provided as part of the base image for the OS (yes, even though it is terribly broken!!!) and anything that depends on e.g. zlib will "find" zlib because of this broken disaster, even though it should use the wrapdb subproject of zlib. It is assumed no one actually wants to mix Strawberry Perl and meson. In fact, some projects, such as gst-build, already unconditionally error out if Strawberry Perl is detected in PATH: error('You have Strawberry Perl in PATH which is known to cause build issues with gst-build. Please remove it from PATH or uninstall it.') Other projects (postgresql) actually do want to build perl extensions, and link to the perl dlls, but absolutely under no circumstances ever want to use its pkg-config implementation. ;) Let's solve this problem by just considering this to not be a valid pkg-config, let the user find another or not have one at all. This change "solves" https://github.com/StrawberryPerl/Perl-Dist-Strawberry/issues/11
2021-10-10simplify some log formatting by splitting out a commonly used format stringEli Schwartz1-5/+4
There are a bunch of cases in a single function where we would want to log the detected path of pkg-config. Formatting this is awkward. Define it once, then use f-strings everywhere. :D
2021-10-10Fix typos discovered by codespellChristian Clauss6-11/+11
2021-10-06cmake: Implement support for interpreting link "keywords"Daniel Mensinger1-10/+32
CMakes `target_link_libraries()` supports certain keywords to only enable specific libraries for specific CMake configurations. We now try our best to replicate this for Meson dependencies. Fixes #9197
2021-10-06cmake: Warn if we could use IMPORTED CMake targetsDaniel Mensinger1-1/+32
2021-10-04dependencies: Dependency.sources can have CustomTargetsDylan Baker1-5/+6
2021-10-04work around flake8 F811 for T.overload redefined functionsEli Schwartz1-2/+2
Since typing != T as far as flake8 is aware, give the linter an extra hint.
2021-10-04remove f from f-string that has no formattingEli Schwartz1-1/+1
2021-10-04coding style: don't format an empty string with another stringEli Schwartz1-1/+1
'{}'.format('foo') for any given value of 'foo' (in this case, a function returning a string), can always just be 'foo' directly, which is a lot more readable.
2021-10-04various python neatness cleanupsEli Schwartz1-2/+2
All changes were created by running "pyupgrade --py3-only" and committing the results. Although this has been performed in the past, newer versions of pyupgrade can automatically catch more opportunities, notably list comprehensions can use generators instead, in the following cases: - unpacking into function arguments as function(*generator) - unpacking into assignments of the form x, y = generator - as the argument to some builtin functions such as min/max/sorted Also catch a few creeping cases of new code added using older styles.
2021-09-25dependencies: Add JDK system dependency for SolarisAlan Coopersmith1-0/+2
Handle is_sunos() machines in __machine_info_to_platform_include_dir
2021-09-14apply flake8 fixes for unused imports and missing importsEli Schwartz2-2/+1
2021-09-12new custom dependency lookup for iconvEli Schwartz2-2/+31
Also internally needed by intl, so add that as a proxied dependency instead of coding it manually.
2021-09-10nagfor OpenMP recognition.Mat Cross1-0/+6
2021-09-07summary: fix dependenciesPaolo Bonzini1-1/+1
Dependencies are currently printed as [<mesonbuild.mlog.AnsiDecorator object at 0x7faa85aeac70>, ' ', <mesonbuild.mlog.AnsiDecorator object at 0x7faa85aeab50>] This was introduced in commit adb1b2f3f6ad54b346348ec6e5b8d96f2f7ba0a6, due to an incorrect type annotation on the AnsiText constructor. Fix both the annotation and the usage. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-08-31pylint: turn on superflous-parensDylan Baker2-2/+2
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
2021-08-15editorconfig: add setting to trim trailing whitespaceEli Schwartz1-2/+2
and clean up all outstanding issues Skip 'test cases/common/141 special characters/meson.build' since it intentionally uses trailing newlines.
2021-08-09pkg-config: support for `-l:libfoo.a`lilinzhe1-0/+24
fixs: #9000 Meson not correctly process with -l:xxx.a link arguments in pkgconfig .pc file. see also:https://stackoverflow.com/questions/48532868/gcc-library-option-with-a-colon-llibevent-a with unit test, unit test will be partially skiped if pkg-config version < 0.28 . see: https://gitlab.freedesktop.org/pkg-config/pkg-config/-/blob/master/NEWS
2021-08-04add boolean parameter use_system for searching boostKevin Meagher1-23/+21
This boolean parameter is added to check_and_set_roots() and detect_lib_dirs() when true it will first search the compiler library directories before checking the standard lib directories. This is set to false when using BOOST_ROOT and set to true when useing other system directories like /usr/local Also simplify using a set to remove duplicate lib files Also remove the part where you search the Cellar in homebrew, this is unnescessary now that symlinks can be followed it should find boost when searching /usr/local so no need to search the Cellar
2021-08-04Make libs a set from the beginingKevin Meagher1-3/+3
2021-08-04Relax restrictions on detecting boost dependencyKevin Meagher1-10/+10
This does two things: * allows the library files to be symlinks * searches `lib` and `lib64` in `BOOST_ROOT` even if it finds lib directories from the compiler The first condition is needed for the homebrew on macOS because boost and boost python are provided in seperate packages and are put together in /usr/local/lib with symlinks to the library files. The both conditions are needed for high performace computing environments where dependencies are often provided in nonstandard directories with symlinks A test case was added which looks for boost libraries in seperate directories which have been symlinked to BOOST_ROOT/lib
2021-08-03Fix when gtest dep is found but does not pass version checkXavier Claessens1-0/+1
GTestDependencySystem (and other similar dep classes) sets self.is_found=True, but the version check could still fail. In the case the dependency is not required `ExternalDependency._check_version()` won't raise an exception and thus the dependency is accepted. _check_version() sets self.is_found() in the case self.version is not empty, we should do it too when self.version is empty. Fixes: #9036.
2021-07-28intl dep: support static kwargEli Schwartz1-1/+4
Since intl links internally to iconv, try to pull in iconv too, but only if we specifically ask for static libs. If PREFER_SHARED, we have no way to tell which type we got, so do not try handling that...
2021-07-28intl: fix incorrect detection of headerEli Schwartz1-1/+1
Although find_library returns the library as a list of args, has_header returns a tuple(is_found, is_cached) which is non-empty and thus always true. Which is confusing... Check whether it actually got found.
2021-07-28dependencies: make the preferred LibType available to any ExternalDependencyEli Schwartz2-4/+4
Just like we automatically provide some reusable glue for self.static, provide it here too. It seems plausibly like something people would commonly want.
2021-07-13dependencies: drop Dependency.methods and Dependency.get_methods()Dylan Baker10-121/+5
Both of these are artifacts of the time before Dependency Factories, when a dependency that could be discovered multiple ways did ugly stuff like finding a specific dependency, then replacing it's own attributes with that dependency's attributes. We don't have cases of that left in the tree, so let's get rid of this code too
2021-07-05condense linesEli Schwartz1-2/+1
2021-07-05more f-strings too complex to be caught by pyupgradeEli Schwartz4-10/+8
2021-07-04dependencies: Deterministic LLVM compile and link arg ordering (#8959)kira781-2/+2
* dependencies: Deterministic LLVM compile and link arg ordering In LLVMDependencyConfigTool, the members compile_args and required_modules are either converted to or stored as sets, which do not have a stable ordering. This results in nondeterministic builds, particularly with required_modules causing the order in which the LLVM libraries are linked in to the output binaries to change across independent builds. As any guarantee about ordering for compile_args is lost by being converted from a list to a set and back, and the modules added to required_modules was even already sorted once, sort both when converting them to lists. * Use mesonlib.OrderedSet instead of sorting the sets. Co-authored-by: Kaelyn Takata <kaelyn.alexi@protonmail.com>
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger4-5/+5
2021-06-26refactor: Refactor BothLibraries logicDaniel Mensinger1-8/+3
This commit introduces a new type of `HoldableObject`: The `SecondLevelHolder`. The primary purpose of this class is to handle cases where two (or more) `HoldableObject`s are stored at the same time (with one default object). The best (and currently only) example here is the `BothLibraries` class.
2021-06-25Split compiler detection from EnvironmentDaniel Mensinger1-2/+2
This moves all the compiler detection logic into the new compilers.detect module. This dramatically reduces the size and complexity of Environment.
2021-06-22fix: Handling BothLibraries objects (fixes #8907)Daniel Mensinger1-3/+8
2021-06-18holders: Introduce HoldableObjectDaniel Mensinger1-2/+2
2021-06-17intl custom dependencyEli Schwartz2-2/+29
Checking how to aquire the *gettext family of symbols portably is annoyingly complex, and may come from the libc, or standalone. builtin dependency: This detects if libintl is unneeded, because the *gettext family of symbols is available in the libc. system dependency: This detects if libintl is installed as separate software, linkable via -lintl; unfortunately, GNU gettext does not ship pkg-config files for it. Fixes #3929
2021-06-17expose SystemDependency and BuiltinDependency as toplevel classesEli Schwartz1-1/+5
mesonbuild.dependencies.__init__ exposes configtool, pkgconfig, cmake and more in __init__.py, so there's no reason we should be tying SystemDependency to the internal organization implementation of the subpackage! In the 2nd previous commit it took quite some effort to figure out that the python module "does not exist" because of import errors while refactoring something completely different.
2021-06-17add new dependency type "builtin"Eli Schwartz2-1/+22
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 Schwartz10-43/+25
In accordance with review comments; it's small enough this seems fitting.
2021-06-14dependencies: Use a typing.NewType for Dependency.type_nameDylan Baker10-27/+33
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-14dependencies: Use the SystemDependencyDylan Baker7-32/+37
This fixes these dependencies, which currently return the name of the dependency as the type. Fixes #8877
2021-06-13dependencies: Add a System DependencyDylan Baker1-0/+29
as a base class for other system dependencies. This will later be used to to fix the type_name vs name confusion.
2021-06-09compilers: Fix missing functions in Compiler base classDaniel Mensinger5-11/+2
2021-06-09typing: Rename some variablesDaniel Mensinger8-45/+54
2021-06-09typing: remove unused DependencyTypeDaniel Mensinger2-2/+2
2021-06-09typing: Fully annotate dependenciesDaniel Mensinger5-72/+76
2021-06-06typing: Fully annotate dependencies.frameworkDaniel Mensinger1-14/+19
2021-06-06typing: Fully annotate dependencies.{detect,factory} + some other fixesDaniel Mensinger7-43/+81