aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/boost.py
AgeCommit message (Collapse)AuthorFilesLines
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-16/+16
performed by running "pyupgrade --py36-plus" and committing the results
2021-01-13Fix misspellsAntonin Décimo1-1/+1
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-11boost: default machine file properties to env var valuesDylan Baker1-50/+15
This both moves the env reading to configuration time, which is useful, and also simplifies the implementation of the boost dependency. The simplification comes from being able to delete basically duplicated code since the values will be in the Properties if they exist at all.
2021-01-04Use a single coredata dictionary for optionsDylan Baker1-3/+3
This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
2021-01-04use OptionKey for builtin and base optionsDylan Baker1-2/+2
I would have prefered to do these seperatately, but they are combined in some cases, so it was much easier to convert them together. this eliminates the builtins_per_machine dict, as it's duplicated with the OptionKey's machine parameter.
2020-11-20use real pathlib moduleDylan Baker1-1/+1
We added the _pathlib module to work around defeciencies in python 3.5's implementation, since we now rely on 3.6 lets drop this
2020-10-04pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger1-1/+1
2020-09-08typing: fix code reviewDaniel Mensinger1-4/+4
2020-09-08typing: more fixesDaniel Mensinger1-1/+3
2020-09-08typing: fully annotate boost and hdf5 depsDaniel Mensinger1-6/+6
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-05-22boost: Try extracting BOOST_ROOT from boost.pcDaniel Mensinger1-1/+12
This is especially useful for Conan, where only the boost.pc file is provided and manually setting BOOST_ROOT is not a good solution since it is in a private cache directory. See #5438
2020-05-22boost: Always sort shared before static (fixes #7171)Daniel Mensinger1-2/+2
2020-05-14boost: always use compiler include pathsDaniel Mensinger1-2/+6
2020-05-14boost: Try finding libraries with the matching arch (fixes #7110)Daniel Mensinger1-5/+42
2020-05-10boost: Do not be strict about static if not specified (fixes #7057)Daniel Mensinger1-1/+2
2020-05-03boost: Do not set BOOST_ALL_DYN_LINK (fixes #7056)Daniel Mensinger1-5/+2
2020-05-01boost: Only use usage-requirements defines (fixes #7046)Daniel Mensinger1-43/+50
2020-04-05boost: Fix library version (fixes #6899)Daniel Mensinger1-0/+5
2020-04-01boost: Fix boost_python detection on bionic (fixes #6886 #4788)Daniel Mensinger1-0/+37
2020-03-28boost: Better python module detectionDaniel Mensinger1-1/+33
2020-03-28boost: Better log found and missing modulesDaniel Mensinger1-4/+18
2020-03-05dependencies/boost: Fix a number of mypy issuesDylan Baker1-8/+8
Since mypy can now see type information for mesonlib it can determine a number of potential errors in the boost module, this fixes those.
2020-03-05remove ability to pass multiple keys to extract_as_listDylan Baker1-1/+1
This makes the typing annotations basically impossible to get right, but if we only have one key then it's easy. Fortunately python provides comprehensions, so we don't even need the ability to pass multiple keys, we can just [extract_as_list(kwargs, c) for c in ('a', 'b', 'c')] and get the same result.
2020-02-20boost: Rewrite the boost system dependencyDaniel Mensinger1-600/+807
This PR significantly improves the handling of the boost library tags and also ensures that the found libraries are always compatible (have the same ABI tag). The current setup can also be extended to filter for additional features (static linking with the runtime, etc.). Additionally, BOOST_ROOT is better supported (it is now guaranteed that all found files belong to a single root directory). Finally, boost.py is now fully annotated (and checked with mypy).
2020-01-29dependencies: Rename _add_sub_dependency2 to _add_sub_dependencyDylan Baker1-1/+1
Since the original _add_sub_dependency is no longer in use.
2020-01-29dependencies: Use a DependencyFactory for threadsDylan Baker1-2/+4
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: Make Dependency initializer signatures matchDylan Baker1-1/+1
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.
2019-07-11Adapting Boost Python library detection to Boost >= 1.67. Closes #4288.gjaeger11-12/+17
2019-06-09Purge `is_cross` and friends without changing user interfacesJohn Ericson1-14/+14
In most cases instead pass `for_machine`, the name of the relevant machines (what compilers target, what targets run on, etc). This allows us to use the cross code path in the native case, deduplicating the code. As one can see, environment got bigger as more information is kept structured there, while ninjabackend got a smaller. Overall a few amount of lines were added, but the hope is what's added is a lot simpler than what's removed.
2019-06-09Use `env.machines.*` to avoid some `is_cross`John Ericson1-8/+8
This is a small example of the `is_cross` removal the that abstraction enables.
2019-05-02Merge pull request #5254 from dcbaker/fix-sub-dependenciesDylan Baker1-1/+1
Fix sub dependencies
2019-05-02dependencies: Use the _add_sub_dependencyDylan Baker1-1/+1
2019-04-28Disable cache for dependenciesDaniel Mensinger1-1/+1
2019-04-28Added some cahced valuesDaniel Mensinger1-1/+1
2019-04-25Don't use len() to test for container emptinessDylan Baker1-2/+2
I ran the numbers once before (it's in the meson history) but it's *much* faster to *not* use len for testing if a container is empty or not.
2019-04-05dependencies/misc: don't special case threadsDylan Baker1-3/+3
Instad of having special casing of threads in the backends and everywehre else, do what we did for openmp, create a real dependency. Then make use of the fact that dependencies can now have sub dependencies to add threads.
2018-11-04Detect clang-cl as msvc-like, not clang-likeJon Turney1-2/+2
Handle clang's cl or clang-cl being in PATH, or set in CC/CXX Future work: checking the name of the executable here seems like a bad idea. These compilers will fail to be detected if they are renamed. v2: Update compiler.get_argument_type() test Fix comparisons of id inside CCompiler, backends and elsewhere v3: ClangClCPPCompiler should be a subclass of ClangClCCompier, as well Future work: mocking in test_find_library_patterns() is effected, as we now test for a subclass, rather than self.id in CCompiler.get_library_naming()
2018-10-25Purge unused argument. Closes #4407.Jussi Pakkanen1-1/+1
2018-08-22find_library: Use _build_wrapper to get library dirsBruce Richardson1-1/+1
This means that we will take into account all the flags set in the cross file when fetching the list of library dirs, which means we won't incorrectly look for 64-bit libraries when building for 32-bit. Signed-off-by: Nirbheek Chauhan <nirbheek@centricular.com> Closes https://github.com/mesonbuild/meson/issues/3881
2018-08-01Consolidate reporting result of a dependency checkJon Turney1-15/+5
If successful, we should identify the method which was successful If successful, we should report the version found (if known) If failing, we should identify the methods we tried Some dependency detectors which had no reporting now gain it There's all kinds of complexities, inconsistencies and special cases hidden in the existing behaviour, e.g.: - boost reports modules requested, and BOOST_ROOT (if set) - gtest/gmock report if they are a prebuilt library or header only - mpi reports the language - qt reports modules requested, and the config tool used or tried - configtool reports the config tool used - llvm reports if missing modules are optional (one per line) We add some simple hooks to allow the dependency object to expose the currently reported information into the consolidated reporting Note that PkgConfigDependency() takes a silent: keyword which is used internallly to suppress reporting. This behaviour isn't needed in find_external_dependency().
2018-07-31Updated boost discovery to handle version >= 1.65 for MSVC (#3961)Derek Kingston1-2/+16
2018-07-01gnome: Use raw link arguments with g-ir and gtk-docNirbheek Chauhan1-3/+3
Those tools use our arguments to build a file and execute it to introspect it at runtime. However, they do not know that you can pass the full path to the library to use, and ignore the arguments. The long-term fix for this is to have them output a .c file that Meson will build for them, which they can then run, but that will require upstream changes: https://gitlab.gnome.org/GNOME/gtk-doc/merge_requests/1 Closes https://github.com/mesonbuild/meson/issues/3774
2018-06-20dependencies: Don't assume self.compiler is a C compilerNirbheek Chauhan1-6/+6
All dependencies were using find_library, has_header, get_define, etc on self.compiler assuming that it's a compiler that outputs and consumes C-like libraries. This is not true for D (and in the future, for Rust) since although they can consume C libraries, they do not use the C ecosystem. For such purposes, we now have self.clib_compiler. Nothing uses self.compiler anymore as a result, and it has been removed.
2018-06-06dependencies: Take options from coredata instead of cmd lineXavier Claessens1-2/+1
These are the last remaining places where attributes set by argparse for "--builtin-option" are used.
2018-03-10Refactor: Add log.error and log.exception to reduce code duplication.Jukka Laurila1-1/+1
2018-02-21Split boost dependency out into separate fileAleksey Filippov1-0/+683
Boost dependency is very complex and it is easier to manage it in a separate file.