aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies
AgeCommit message (Collapse)AuthorFilesLines
2020-11-12dependencies: Put pkgconfig options before operandsHaelwenn (lanodan) Monnier1-1/+5
This fixes building with meson when the POSIX behavior of getopt is used, such as when GNU libc is used with POSIXLY_CORRECT=1 defined
2020-10-30qt: dependency: Strip tool versions from newlinesLaurent Pinchart1-1/+1
When finding the Qt compilation tools (moc, uic, rcc, lrelease), the version strings contain a trailing newline character. This results in a stray newline in the meson log: Detecting Qt5 tools Program /usr/lib64/qt5/bin/moc found: YES 5.14.2 (/usr/lib64/qt5/bin/moc) Program /usr/lib64/qt5/bin/uic found: YES 5.14.2 (/usr/lib64/qt5/bin/uic) Program /usr/lib64/qt5/bin/rcc found: YES 5.14.2 (/usr/lib64/qt5/bin/rcc) Program /usr/lib64/qt5/bin/lrelease found: YES 5.14.2 (/usr/lib64/qt5/bin/lrelease) Strip the version to avoid this, resulting in a cleaner log: Detecting Qt5 tools Program /usr/lib64/qt5/bin/moc found: YES 5.14.2 (/usr/lib64/qt5/bin/moc) Program /usr/lib64/qt5/bin/uic found: YES 5.14.2 (/usr/lib64/qt5/bin/uic) Program /usr/lib64/qt5/bin/rcc found: YES 5.14.2 (/usr/lib64/qt5/bin/rcc) Program /usr/lib64/qt5/bin/lrelease found: YES 5.14.2 (/usr/lib64/qt5/bin/lrelease) Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
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-10-16cmake: ignore CMAKE_TOOLCHAIN_FILE and CMAKE_PROJECT_INCLUDE to avoid ↵Daniel Mensinger1-1/+2
conflicts with the meson CMake logic
2020-10-13cmake: Add cross compilation supportDaniel Mensinger1-9/+21
2020-10-13cuda: Also read CUDART_VERSION from cuda_runtime_api.hDaniel Mensinger1-2/+25
2020-10-08dependency: support boolean argument "allow_fallback"Paolo Bonzini1-2/+4
Sometimes, distros want to configure a project so that it does not use any bundled library. In this case, meson.build might want to do something like this, where slirp is a combo option with values auto/system/internal: slirp = dependency('', required: false) if get_option('slirp') != 'internal' slirp = dependency('slirp', required: get_option('slirp') == 'system') endif if not slirp.found() slirp = subproject('libslirp', ...) .variable('...') endif and we cannot use "fallback" because the "system" value should never look for a subproject. This worked until 0.54.x, but in 0.55.x this breaks because of the automatic subproject search. Note that the desired effect here is backwards compared to the policy of doing an automatic search on "required: true"; we only want to do the search if "required" is false! It would be possible to look for the dependency with `required: false` and issue the error manually, but it's ugly and it may produce an error message that looks "different" from Meson's. Instead, with this change it is possible to achieve this effect in an even simpler way: slirp = dependency('slirp', required: get_option('slirp') != 'auto', allow_fallback: get_option('slirp') == 'system' ? false : ['slirp', 'libslirp_dep']) The patch also adds support for "allow_fallback: true", which is simple and enables automatic fallback to a wrap even for non-required dependencies.
2020-10-08interpreter: clean up handling of force_fallbackPaolo Bonzini1-1/+1
Force_fallback is not an interpreter keyword argument, and there is no reason to handle it as one since it is not used anywhere else (and in fact is explicitly ignored by get_dep_identifier). Use a Python keyword argument instead, which makes the code simpler.
2020-10-04pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger5-5/+5
2020-10-04cmake: switch to pathlib (fixes #7322)Daniel Mensinger1-4/+4
2020-09-29dependencies/curses: don't try ncurses-config or system dependency on windowsDylan Baker1-5/+9
with msys ncurses-config returns a unix style path (currently, though it's been fixed upstream), which the compilers don't understand, so we can't do that. Additionally, while the system search does work, there's missing include directories that need to be added.
2020-09-29dependencies/curses: Add support for pdcursesYonggang Luo1-1/+6
On win32 there is pdcurses, so we detect it first, because python depends on ncursesw, so if we don't want to use ncursesw, we should make sure pdcurses detect before ncursesw
2020-09-29dependencies/curses: Add a system dependencyDylan Baker1-1/+58
That calls find_library and has_header in conjunction to look for curses implementations that are baked into the system without any other find method.
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-09-29dependencies/curses: Add support for using the ncurses config toolsDylan Baker1-1/+20
These are mostly duplicated with pkg-config, but maybe someone has one but not another, and they're easy to turn on with the ConfigToolDependency.
2020-09-29dependency/misc: change lookup order for curses pkg-configDylan Baker1-1/+1
look for (in order): ncursesw, ncurses, curses.
2020-09-29dependencies/misc: Fix typing of curses_factoryDylan Baker1-3/+3
2020-09-29Merge pull request #7758 from dcbaker/submit/hdf5-factoryDylan Baker3-110/+151
dependencies/hdf5: Convert to a dependency_factory
2020-09-28typing: fully annotate cmake.executorDaniel Mensinger1-5/+5
2020-09-25dependencies/hdf5: Use the correct compilers for the machineDylan Baker1-5/+19
Instead of the default ones, this is especially important when cross compiling or when using compilers that aren't compatible with the default ones. squash! dependencies/hdf5: Use the actual system compilers
2020-09-25dependencies/hdf5: Convert to a dependency_factoryDylan Baker3-109/+136
Instead of a mega dependency that does everything, use a dependency factory for config-tool and pkg-config
2020-09-22pylint: Turn on warnings for incorrect number of argsDylan Baker1-4/+4
This catches some very real errors. The one in scalapack is pretty silly actually, it's failing to figure out that the exploded list is at least two arguments. However, the code is actually clearer by not using a list and exploding it, so I've done that and pylint is happy too.
2020-09-14InternalDependency: Add as_link_whole() methodXavier Claessens1-0/+5
2020-09-13external-project: New module to build configure/make projectsXavier Claessens1-11/+18
This adds an experimental meson module to build projects with other build systems. Closes: #4316
2020-09-08typing: fix code reviewDaniel Mensinger1-4/+4
2020-09-08typing: more fixesDaniel Mensinger1-1/+3
2020-09-08typing: fix dependencies for new follow_importsDaniel Mensinger3-14/+17
2020-09-08typing: ignore error because of untyped decoratorDaniel Mensinger1-1/+1
2020-09-08typing: fully annotate boost and hdf5 depsDaniel Mensinger2-8/+12
2020-09-08Add some type hints to the ExternalProgram classNirbheek Chauhan1-7/+7
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/mpi: add missing annotationDylan Baker1-3/+3
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-11Add h5cc shlib argument for correctly link hdf5 librariesWilliam F Godoy1-1/+2
respect "static" key in dependency function -shlib for static dependency -noshlib for static dependency
2020-08-07qt dependency: do not require all the tools automaticallyEli Schwartz1-5/+5
The compilers_detect function is only used in the qt module, which checks every time before using a specific compiler, if it is found. e.g. meson.build:10:6: ERROR: MOC sources specified and couldn't find moc-qt5, please check your qt5 installation In fact, the current check means we never even hit this error to begin with, because we previously died on the uninformative error: meson.build:10:6: ERROR: Program(s) ['moc'] not found or not executable which doesn't actually tell the user why this matters, and is all around a waste of time. Fixes #5582
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-23Merge pull request #7460 from mensinda/fixDeepcpyJussi Pakkanen1-0/+10
deps: Do not deepcopy internal libraries (fixes #7457)
2020-07-21Add boost_root support to properties files (#7210)cmcneish1-40/+108
* Add boost_root support to properties files This commit implements `boost_root`, `boost_includedir`, and `boost_librarydir` variable support to native and cross properties files. The search order is currently environment variables, then these variables, and finally a platform-dependent search. * Add preliminary boost_root / boost_includedir tests Each test contains a fake "version.hpp", as that's how boost detection is currently being done. We look for this file relative to the root directory, which probably shouldn't be allowed (it previously was for BOOST_LIBRARYDIR but not for BOOST_ROOT). It also cannot help with breakage detection in libraries, however it looks like this wasn't getting tested beforehand. I've given the two unique version numbers that shouldn't be present in any stock version of boost (001 and 002). * Add return type to detect_split_root * Return empty list when nothing found in BOOST_ROOT, rather than None * Update boost_root tests * Create nativefile.ini based on location of run_project_tests.py * Add fake libraries to ensure boost_librarydir is being used * Require all search paths for boost to be absolute * Redo boost search ordering To better match things like pkg-config, we now look through native/cross files, then environment variables, then system locations for boost installations. Path detection does not fall back from one method to the next for properties or environment variables--if boost_root, boost_librarydir, or boost_includedir is specified, they must be sufficient to find boost. Likewise for BOOST_ROOT and friends. pkg-config detection is still optional falling back to system-wide detection, for Conan. (Also, fix a typo in test 33's nativefile) * Correct return type for detect_roots * Correct boost dependency search order in documentation * Print debug information for boost library finding, to resolve CI issues * Handle native/cross file templates in a more consistent way All tests can now create a `nativefile.ini.in` if they need to use some parameter that the testing framework knows about but they can't. * Pass str--rather than PosixPath--to os.path.exists, for Python35 * Look for boost minor versions, rather than boost patch versions in test cases * Drop fake dylib versions of boost_regex * Prefer get_env_var to use of os.environ * Correct error reporting for relative BOOST_ROOT paths * Bump version this appears in. Also, change "properties file" to "machine file" as that appears to be the more common language.
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-07-04qt: Fix has_tools() when required=FalseXavier Claessens1-12/+15
Improve logs by making it clear when the program is found but has wrong version.
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 Baker2-24/+29
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.