aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/dev.py
AgeCommit message (Collapse)AuthorFilesLines
2022-12-15Change double quote doc comment to sinqle quoteTristan Partin1-2/+2
2022-12-15Try to find the jni dependency when javac is a Darwin stubTristan Partin1-11/+25
Darwin-based systems, at least macOS, provide various JDK executable stubs in /System/Library/Frameworks/JavaVM.framework/Versions/*/Commands. These stubs are placed in such a way that they break the heuristics of the JNI system dependency. If a javac being analyzed to find a Java home is a stub, use /usr/libexec/java_home. See https://stackoverflow.com/a/15133344/7572728 for more details. Closes #11173
2022-12-14Deduplicate code in JNISystemDependency conditionalTristan Partin1-2/+2
2022-11-29pylint: enable implicit-str-concatDylan Baker1-1/+1
Which catches a very real bug. The zlib system dependency failed to work on MSVC since initial implementation in commit c1a3b37ab7e4ccf3a946ee4ba6da81a4c230ecc4 -- it looked for the wrong name.
2022-11-29Fix crash when toolchain is missingSmallWood-D1-5/+0
Add a MissingCompiler class returned by compiler detecting methods intead of None - accessing such an object raises a DependencyException Fixes #10586 Co-authored-by: duckflyer <duckflyer@gmail.com>
2022-10-24Move JNISystemDependency to dependencies.base.detect_compilerTristan Partin1-3/+2
Only searches if the project already added that language before.
2022-10-09Fix some wording in a JNISystemDependency commentTristan Partin1-1/+1
2022-10-09Add BSD support to the JNISystemDependencyTristan Partin1-0/+8
Supports all BSDs that Meson currently supports. Fixes #10883
2022-09-19compilers: perform targeted imports for detectEli Schwartz1-2/+2
Only import the ones we need for the language we are detecting, once we actually detect that language. This will allow finally dropping the main imports of these files in a followup commit.
2022-09-19compilers: directly import from subpackagesEli Schwartz1-1/+3
It turns out we don't generally need to proxy every compiler ever through the top-level package. The number of times we directly poke at one is negligible and direct imports are pretty clean.
2022-09-12dependencies: simplify logging methodsEli Schwartz1-6/+0
A bunch of SystemDependency subclasses overrode log_tried() even though they used the same function anyway. Delete them -- they still print the same thing either way.
2022-08-29flake8: fix typing casts to not have actual objectsEli Schwartz1-1/+1
We use `__future__.annotations` to good effect everywhere we can, and one of the effects of this is that annotations are automatically stringized and don't need to be evaluated, using less memory and computation. But this only affects actual annotations -- a cast is just a function with an argument, so the compiler has no idea that it's an annotation to be stringized. Do this manually.
2022-05-01cmake: Fix CMake LLVM dependency error (fixes #10322)Daniel Mensinger1-2/+9
2022-04-12cmake: Always use all compilers for LLVM (fixes #10249)Daniel Mensinger1-1/+12
2022-03-29move a bunch of imports into TYPE_CHECKING blocksEli Schwartz1-2/+3
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-04Add modules kwarg to JNI system depTristan Partin1-3/+58
This allows someone to link against libjvm.so and libjawt.so.
2022-03-02Rename JDK system dep to JNITristan Partin1-3/+18
JNI is a more apt name because it currently only supports the JNI. I also believe that CMake uses the terminology JNI here as well. JNI is currently the only way to interact with the JVM through native code, but there is a project called "Project Panama" which aims to be another way for native code to interact with the JVM.
2022-03-01mark a bunch of dependencies with the version they were introducedEli Schwartz1-0/+1
All these dependencies are impossible to find on versions of Meson older than the ones they got custom lookups in, because they don't provide pkg-config files. So they should not / cannot be reasonably used on older versions, and it is easy to say "yep, these should emit a FeatureNew for the versions they got added in".
2021-11-20dependencies/zlib: Allow for generic OS checksDudemanguy1-4/+1
Contrary to most system method checks, zlib currently functions as a whitelist of OSes. This isn't really needed however. The first special case for OSes that provide zlib as part of the base OS is worth keeping. However, the elif for windows is more than generic enough to allow any other potential OSes to try. Just make it a simplie if/else instead.
2021-11-15dependencies/zlib: Add system zlib method for androidDudemanguy1-2/+2
The same method that the BSDs use should also work for android. Also update the tests and docs where appropriate.
2021-10-27fix various flake8 whitespace errorsEli Schwartz1-1/+1
2021-09-25dependencies: Add JDK system dependency for SolarisAlan Coopersmith1-0/+2
Handle is_sunos() machines in __machine_info_to_platform_include_dir
2021-07-13dependencies: drop Dependency.methods and Dependency.get_methods()Dylan Baker1-17/+0
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-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-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-17move base class for system dependencies into base.pyEli Schwartz1-2/+1
In accordance with review comments; it's small enough this seems fitting.
2021-06-14dependencies: Use the SystemDependencyDylan Baker1-8/+9
This fixes these dependencies, which currently return the name of the dependency as the type. Fixes #8877
2021-06-09compilers: Fix missing functions in Compiler base classDaniel Mensinger1-2/+1
2021-06-09typing: Fully annotate dependenciesDaniel Mensinger1-28/+28
2021-06-03deps: Split dependencies.baseDaniel Mensinger1-4/+5
Split the Factory and dependency classes out of the base.py script to improve maintainability.
2021-05-28dependencies/zlib: System Dependency needs a clib_compiler on windowsDylan Baker1-3/+8
Otherwise it'll except when it tries to get an attribute from None that doesn't exist.
2021-04-12dependency: Add JDK system dependencyTristan Partin1-0/+56
The JDK system dependency is important for detecting JDK include paths that may be useful when developing a JNI interface.
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-10/+10
performed by running "pyupgrade --py36-plus" and committing the results
2020-10-22depenencies/llvm: Handle llvm-config --shared-mode failing (#7379)Dylan Baker1-1/+7
* depenencies/llvm: Handle llvm-config --shared-mode failing Fixes: #7371 Fixes: #7878 * test cases/llvm: Refactor to use test.json Instead of trying to cover everything internally
2020-09-29dependencies/zlib: Fix header detectionDylan Baker1-1/+1
has_header returns a tuple of (found: bool, cached: bool), so `if has_header` will always return true because the tuple is non-empty. We need to check if the found value is true or not.
2020-04-12Fix VS Intellisense for projects which depend on LLVM found via CMake.Jesse Natalie1-0/+3
2020-04-10Log when ignoring LLVM because dynamic was requestedJesse Natalie1-0/+1
Without this, there's tons of log output about finding LLVM, followed by "couldn't find LLVM."
2020-03-19cmake: Add find_package COMPONETS supportDaniel Mensinger1-1/+1
2020-01-31dependencies: Add a zlib system dependency for windowsDylan Baker1-2/+20
2020-01-31dependencies: Add system zlib method for freebsd and dragonflybsdDylan Baker1-3/+8
I've tested this on FreeBSD, and dragonfly's userland is close enough I'm willing to call it good without testing. OpenBSD and NetBSD also have a zlib in their base configurations, but I'm not confident enough to enable those without testing.
2020-01-31dependencies: Add a zlib system dependency for macOSDylan Baker1-0/+30
This comes pre-installed, but currently we don't have a way to detect it without relying on pkg-config or cmake. This is only valid with the apple clang-based compilers, as they do some special magic to get headers.
2020-01-30Small cleanups for the LLVM dependency class (#6548)Dylan Baker1-1/+6
2020-01-29dependencies: Rename _add_sub_dependency2 to _add_sub_dependencyDylan Baker1-5/+5
Since the original _add_sub_dependency is no longer in use.
2020-01-29dependencies: Use a DependencyFactory for threadsDylan Baker1-5/+13
This lets us make a number of uses of threads safer, because we can use the threads_factory instead of the ThreadDependency
2020-01-29dependencies: Use DependencyFactory for gmockDylan Baker1-20/+23
2020-01-29dependencies: Use a DependencyFactory for gtestDylan Baker1-20/+21
2020-01-29dependencies: Use a DependencyFactory for LLVMDylan Baker1-27/+15
2020-01-29dependencies: Make Dependency initializer signatures matchDylan Baker1-5/+5
Currently PkgConfig takes language as a keyword parameter in position 3, while the others take it as positional in position 2. Because most dependencies don't actually set a language (they use C style linking), using a positional argument makes more sense. ExtraFrameworkDependencies is even more different, and duplicates some arguments from the base ExternalDependency class. For later changes I'm planning to make having all of the dependencies use the same signature is really, really helpful.
2020-01-29dependencies/base: Split process_method_kw out of DependencyDylan Baker1-4/+4
I want to use this in a new class as well, that doesn't descend from Dependency.
2020-01-26cmake: Refactor CMakeExecutor and CMakeTraceParserDaniel Mensinger1-0/+3
This moves most of the execution code from the CMakeInterpreter into CMakeExecutor. Also, CMakeTraceParser is now responsible for determining the trace cmd arguments.