aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/base.py
AgeCommit message (Collapse)AuthorFilesLines
2020-09-08Fix picking up tools with args from the env on WindowsNirbheek Chauhan1-1/+8
This was a regression in https://github.com/mesonbuild/meson/pull/7059. We do not need to do a full search for all windows special cases. We only want to check whether the command provided is actually a full path to a script so we can add the interpreter. Fixes https://github.com/mesonbuild/meson/issues/7645
2020-09-02cmake: Don't link DEBUG to CRT when not building with MSVCNirbheek Chauhan1-1/+3
is_debug doesn't just control the CRT, it also controls the 'debug configuration' which is unrelated to the CRT setting on non-MSVC. Fixes https://github.com/mesonbuild/meson/issues/7631
2020-09-02dependencies: Fix type of dependency_factory decoratorDylan Baker1-13/+11
There was both a straight up bug in the type signature (the return type is List[Callable[[], Dependency]] not List[Type[Dependency]]), and in the way the arguments are assembled. Typing is pretty limited in it's ability to express decorators, so the best mypy can do is check the return types (I think). I've done what the docs suggest and it's stopped complaining.
2020-08-18Interpreter: Fix c_stdlib usageXavier Claessens1-1/+1
- Exceptions raised during subproject setup were ignored. - Allow c_stdlib in native file, was already half supported. - Eliminate usage of subproject variable name by overriding '<lang>_stdlib' dependency name.
2020-08-05cmake: Use the DEBUG config when linking to the debug CRTNirbheek Chauhan1-1/+4
The `debug` builtin option does not control whether or not the debug CRT is used. Without this fix, when buildtype=debugoptimized or when debug=true + b_vscrt=md, we will try to link to the debug libraries found via cmake while linking with `/release`, which will cause a link failure.
2020-07-23Merge pull request #7461 from mensinda/noMoreSetuptoolsJussi Pakkanen1-4/+2
Remove the setuptools dependency with mesondata.py
2020-07-16mdata: remove setuptools and use mesondata insteadDaniel Mensinger1-4/+2
2020-07-16deps: Do not deepcopy internal libraries (fixes #7457)Daniel Mensinger1-0/+10
2020-06-14Use cmake args also when calling get_cmake_infoVili Väinölä1-4/+4
- vcpkg libraries are not found when given cmake_toolchain_file and vcpkg_target_triplet as cmake_args when looking for the dependency if the first call to cmake has different arguments. The libraries are found if the first call has same arguments or if the CMakeCache.txt is deleted in call_with_fake_build.
2020-06-13cmake: Fix handling of path seperators (fixes #7294)Daniel Mensinger1-3/+8
2020-06-12dependencies: Add a couple of type annotationsDylan Baker1-2/+3
2020-06-12dependencies: Don't allow using the default binary for host on cross compilesDylan Baker1-4/+4
Otherwise we can end up finding dependencies from the build machine for the host machine, which is incorrect. This alters cmake, pkg-config, and all config-tool based dependencies. Fixes: #7276
2020-06-12dependencies: Don't try to find a binary by "default_path" when cross compilingDylan Baker1-4/+7
2020-06-12dependencies: Split search_tool out of ExternalDependencyDylan Baker1-21/+25
it really doesn't make sense to put this in the ExternalDependency class. It doesn't rely on any of the state of that class, and it's generically useful inside meson.
2020-06-12cmake: Subprojects support CMAKE_PREFIX_PATH (fixes #7249)Daniel Mensinger1-15/+1
2020-06-10Fix python3 installed from the Windows StoreD Scott Phillips1-3/+12
When meson is currently being run with a python that seems to have been installed from the Windows Store, replace the general WindowsApps directory in search paths with dirname(sys.executable), and also handle failures with pathlib.resolve on WindowsApps exe files.
2020-06-10dependencies: Remove finish_init methodDylan Baker1-2/+0
This is a holdover from before we had the DependencyFactory. It should have already been refactored into the initializer, but wasn't for some reason.
2020-05-24fix cmake target configuration selection.Alexander Neumann1-2/+9
2020-05-11ConfigToolDependency: Don't fallback to system tool when cross compilingXavier Claessens1-21/+4
The system tool is always the wrong thing to use and cause hard to debug issues when trying to link system libraries with cross built binaries. The ExternalDependency base class already had a method to deal with this, used by PkgConfigDependency and QtBaseDependency, so it should make things more consistent.
2020-04-30ExternalProgram: Do special windows tricks even when name is providedXavier Claessens1-0/+4
Closes: #7051
2020-04-21Use pkg_resource to find resources files (data)Dylan Baker1-2/+4
Doing this by hand is fraught with corner cases, and we're running into some of those problems already. setuptools pkg_resource is a well tested solution for not running into corner cases, and we already rely on setuptools to make our entry point scripts work, so we might as well make us of the other things it can solve for us. Fixes #6801
2020-04-15dependencies/cmake: Only use abs paths as link argsDaniel Stone1-1/+5
When taking library dependencies from CMake, we first attempt to look the dependency up in the target list, then fall back to treating it as a path, which we add if the path exists. As there is no check for whether or not the path is really a path, this can cause false positives; for example if a 'uuid' dependency was passed intending to be a target, but it cannot be found and the current directory also contains a file or directory named 'uuid', we will just include the string 'uuid' in library dependencies. This is particularly prevalent on Windows, where a system library called 'version' exists, and thanks to case insensitivity will match a file called 'VERSION' if found in the source root when running Meson from the source directory, or a generated file when running Meson from the build directory. Fix this check to only look up filesystem existence on absolute paths, not unqualified. This also adds a fallback warning in case an argument cannot be found, rather than silently falling back.
2020-04-15dependencies/cmake: Suffix bare library dependencies on WindowsDaniel Stone1-0/+9
On Windows, library dependencies can be passed with no prefix or suffix; rather than -lfoo or foo.dll, they can just be passed as 'foo'. CMake handles this and suffixes the library with '.lib' or '.dll', depending on the link mode. Do the same here, and if we've been passed an unqualified non-option bare name on Windows, add the appropriate suffix and pass it through to the linker. This fixes dependencies on system libraries.
2020-04-15dependencies/cmake: Add Windows/VS library regexDaniel Stone1-1/+2
When finding dependencies from CMake, use a smarter regex to determine whether or not a dependency is actually a link argument, and pass through Windows link arguments properly.
2020-03-23Fix legacy env var support with crossJohn Ericson1-7/+19
Fix #3969
2020-03-19dependencies/base: Make the ConfigTool Dependency more flexibleDylan Baker1-5/+18
2020-03-19cmake: Add find_package COMPONETS supportDaniel Mensinger1-5/+24
2020-03-05dependencies: Use CompilerType not CompilerDylan Baker1-2/+2
Compiler is invariant, in other words Compiler and only Compiler can fulfull it, it's derived classes cannot be used. CompilerType is covariant, that is Compiler and any derived class can fulfill it. This fixes a number of issues in the boost module.
2020-02-17version parsing: match only when version starts with a numberGerion Entrup1-1/+1
This leads to better version parsing. An concrete example use case is llc. When invoking llc with "--version", the output is ``` LLVM (http://llvm.org/): LLVM version 9.0.1 ... ``` The old version parsing recognizes the dot in the first line as version. This commit also tries to adapt the two regexes to each other. Reported-by: Björn Fiedler <fiedler@sra.uni-hannover.de>
2020-02-17base.py: remove trailing whitespaceGerion Entrup1-2/+2
2020-02-05Fix import dependency from dubMax1-0/+8
2020-01-30Qt5: Do not use system qmake if not specified in cross fileXavier Claessens1-20/+20
There is a comment saying we do it because we used to do it. But it's wrong and lead to using system library when cross compiling. Factor out the code we use to find pkg-config, because it is the same use-case.
2020-01-29deps: Fix prelimenary CMake lookup.Daniel Mensinger1-3/+7
The CMake config files / modules have to be checked case insensitive in some cases, otherwise some dependencies will not be found even though they are installed.
2020-01-29dependencies: Rename _add_sub_dependency2 to _add_sub_dependencyDylan Baker1-15/+1
Since the original _add_sub_dependency is no longer in use.
2020-01-29dependencies: Split detect_compiler out of dependencyDylan Baker1-19/+24
We need it for dependency factories as well.
2020-01-29dependencies: Use a DependencyFactory for threadsDylan Baker1-3/+3
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: Remove now dead codeDylan Baker1-24/+0
Mostly this is the metagprogramming that ConfigToolDependency used to do, but doesn't need anymore.
2020-01-29dependencies: Add a decorator for dependency factory functionsDylan Baker1-0/+27
This helps make them a bit more self documenting, and remove a bit of the boilerplate they would otherwise have to each implement.
2020-01-29dependencies: Use a DependencyFactory for LLVMDylan Baker1-1/+5
2020-01-29dependencies: Add a sub_dependency_method that takes a list ofDylan Baker1-0/+16
dependencies This will be useful for adding dependencies that come from a factory, and thus are a list.
2020-01-29dependencies: Add a DependencyFactory classDylan Baker1-5/+82
Instead of using dependencies as their own factories, which is rather odd, lets just add a dedicated DependencyFactory class. This should be able to take over for a lot of the factory type dependencies really easily, and reduce the amount of code we have.
2020-01-29dependencies: Make Dependency initializer signatures matchDylan Baker1-17/+15
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-33/+34
I want to use this in a new class as well, that doesn't descend from Dependency.
2020-01-27Merge pull request #6432 from mensinda/cmExeRefactorJussi Pakkanen1-9/+21
cmake: Refactor CMakeExecutor and CMakeTraceParser
2020-01-27Merge pull request #6423 from dcbaker/declare-dependency-variablesJussi Pakkanen1-6/+22
Add ability to set and query arbitrary variables on declare_dependency objects
2020-01-26cmake: Refactor CMakeExecutor and CMakeTraceParserDaniel Mensinger1-9/+21
This moves most of the execution code from the CMakeInterpreter into CMakeExecutor. Also, CMakeTraceParser is now responsible for determining the trace cmd arguments.
2020-01-23cmake: Always Add C, CXX if no language is specified (fixes #6441)Daniel Mensinger1-29/+24
2020-01-22envconfig: add pkg_config_libdir propertyStéphane Cerveau1-0/+6
In order to unify the use of sysroot in the cross-file, the pkg_config_libdir can now be passed directly in the file.
2020-01-15find_program: Always use USERPROFILE instead of HOMENirbheek Chauhan1-1/+4
On MSYS2 and MSYS, Python reads HOME instead of USERPROFILE, which gets the path wrong. Serves me right for not writing a test!!
2020-01-14find_program: Ignore programs in the WindowsApps directoryNirbheek Chauhan1-2/+18
The latest Windows 10 release in May 2019 added zero-sized files that act as stubs which when launched from cmd.exe spawn the Windows Store to install those apps. This also includes python.exe and python3.exe: https://devblogs.microsoft.com/python/python-in-the-windows-10-may-2019-update/ Unfortunately, `import('python').find_installation('python3')` will then think that python3.exe is available on Windows. Or, worse, if the user has a fresh installation of Windows 10 and then installs the Python 3 using the official installer (not the Windows Store app), we will *still* pickup this stub because it will be first in `PATH`. Always remove the WindowsApps directory from `PATH` while searching. First reported at https://gitlab.freedesktop.org/gstreamer/cerbero/issues/223