summaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Refactor handling of machine file optionsXavier Claessens2020-10-161-3/+2
| | | | | | It is much easier to not try to parse options into complicated structures until we actually collected all options: machine files, command line, project()'s default_options, environment.
* Fix consistency in variables kwargXavier Claessens2020-10-161-6/+27
| | | | | Share common code to extract the `variables` kwarg in declare_dependency() and pkg.generate().
* Add wrap mode to disable auto promoteXavier Claessens2020-10-131-6/+7
|
* interpreter: Improve message when fallback dependency is not foundXavier Claessens2020-10-131-32/+48
| | | | | | | | | | - Log the message before raising the exception. - Add a reason when the dependency is not found because the subproject failed to configure, because it was not obvious in the case the subproject failed to configure earlier while looking for an optional dependency. - Avoid double message when the subproject has overriden the dependency and we provided the fallback variable as well.
* Merge wraps from subprojects into wraps from main projectXavier Claessens2020-10-131-60/+34
| | | | | | | | | | | | | wraps from subprojects are now merged into the list of wraps from main project, so they can be used to download dependencies of dependencies instead of having to promote wraps manually. If multiple projects provides the same wrap file, the first one to be configured wins. This also fix usage of sub-subproject that don't have wrap files. We can now configure B when its source tree is at `subprojects/A/subprojects/B/`. This has the implication that we cannot assume that subproject "foo" is at `self.subproject_dir / 'foo'` any more.
* interpreter: Rename dirname to subp_nameXavier Claessens2020-10-131-65/+65
| | | | | | | | dirname is confusing because the name of a subproject does not always match its directory name, the wrap file can define another directory. For example foo.wrap will often extract the subproject into foo-1.2 directory, in that case the subproject name is 'foo' and the subproject directory is 'foo-1.2'.
* include_type: honor include_type in dependency fallbacks (fixes #7503)Daniel Mensinger2020-10-131-0/+8
|
* mtest: Allow filtering tests by subprojectNirbheek Chauhan2020-10-131-4/+9
| | | | | | | | | | | | You could always specify a list of tests to run by passing the names as arguments to `meson test`. If there were multiple tests with that name (in the same project or different subprojects), all of them would be run. Now you can: 1. Run all tests with the specified name from a specific subproject: `meson test subprojname:testname` 1. Run all tests defined in a specific subproject: `meson test subprojectname:` Also forbid ':' in test names. We already forbid this elsewhere, so should not be a big deal.
* dependency: support boolean argument "allow_fallback"Paolo Bonzini2020-10-081-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* interpreter: clean up handling of force_fallbackPaolo Bonzini2020-10-081-13/+12
| | | | | | | | 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.
* interpreter: refactor handling of dependency(fallback: ...)Paolo Bonzini2020-10-081-21/+22
|
* pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger2020-10-041-1/+1
|
* cmake: switch to pathlib (fixes #7322)Daniel Mensinger2020-10-041-1/+1
|
* deprecated get_configtool_variable and get_pkgconfig_variableDylan Baker2020-10-011-0/+4
| | | | | | The get_variable method is able to do everything they do and more, making it generally more useful. Let's tell people to stop using the old ones.
* Add meson.project_build/source_root() methodsXavier Claessens2020-09-281-0/+22
|
* Deprecate meson.build_root() and meson.source_root()Xavier Claessens2020-09-231-0/+2
| | | | | | Those function are common source of issue when used in a subproject because they point to the parent project root which is rarely what is expected and is a violation of subproject isolation.
* InternalDependency: Add as_link_whole() methodXavier Claessens2020-09-141-0/+10
|
* external-project: New module to build configure/make projectsXavier Claessens2020-09-131-0/+4
| | | | | | | This adds an experimental meson module to build projects with other build systems. Closes: #4316
* Allow installing dir from build dirXavier Claessens2020-09-131-1/+3
|
* Identify machine in error accesing compiler object for missing languageJon Turney2020-09-101-1/+1
| | | | Also add a failing test case for that error.
* Don't require build machine compilers for project() languagesJon Turney2020-09-101-1/+3
| | | | | | | This means that, in the common case of a simple meson.build which doesn't contain any 'native: true' targets, we won't require a native compiler when cross-compiling, without needing any changes in the meson.build.
* typing: more fixesDaniel Mensinger2020-09-081-14/+28
|
* Special case meson.version().version_compare() statementXavier Claessens2020-09-021-2/+2
| | | | | | | | | when that statement gets evaluated, the interpreter remembers the version target and if it was part of the evaluation of a `if` condition then the target meson version is temporally overriden within that if-block. Fixes: #7590
* interpreter: Do not get variable on failed subprojectXavier Claessens2020-08-201-4/+9
| | | | Fixes: #7620
* simplify shutil usage by invoking copy2 where appropriateEli Schwartz2020-08-201-2/+1
| | | | It's equivalent to copyfile + copystat with the same arguments.
* Interpreter: Fix c_stdlib usageXavier Claessens2020-08-181-24/+25
| | | | | | | - 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.
* find_library: Print type of library not foundNirbheek Chauhan2020-08-151-2/+7
| | | | | If we can't find a static library, we should say that. It's confusing otherwise.
* interpreter: Don't force fallback when subproject failed to configureXavier Claessens2020-08-121-1/+2
| | | | Fixes: #7534
* interpreter: Lower case languages before checking if 'c' is in the listXavier Claessens2020-08-071-1/+1
| | | | Fixes: #7495
* Capitalize some constants in coredataJohn Ericson2020-08-041-1/+1
| | | | | I've been getting confused between them and similarly-named other things, so I figured it was high time to clean this up.
* Put machine file and cmd line parsing in EnvironmentDylan Baker2020-08-011-3/+5
| | | | | | | | | This creates a full set of option in environment that mirror those in coredata, this mirroring of the coredata structure is convenient because lookups int env (such as when initializing compilers) becomes a straight dict lookup, with no list iteration. It also means that all of the command line and machine files are read and stored in the correct order before they're ever accessed, simplifying the logic of using them.
* Allow setting built-in options from cross/native filesDylan Baker2020-08-011-0/+1
| | | | | | | | | | This is like the project options, but for meson builtin options. The only real differences here have to do with the differences between meson builtin options and project options. Some meson options can be set on a per-machine basis (build.pkg_config_path vs pkg_config_path) others can be set on a per-subproject basis, but should inherit the parent setting.
* Only emit warning about "native:" on projects with minimum required versionZbigniew Jędrzejewski-Szmek2020-07-281-2/+5
| | | | | | | | | 'native:' keyword was only added in 0.54. For projects declaring meson_version >= 0.54, warn, because those projects can and should set the keyword. For older projects declaring support for older versions, don't warn and use the default implicitly. Fixes https://github.com/mesonbuild/meson/issues/6849.
* summary: Wrap lines when printing listsXavier Claessens2020-07-211-5/+29
| | | | | | When a list_sep is provided (e.g. ', ') all items are printed on the same line, which gets ugly on very long lists (e.g. list of plugins enabled).
* Print a warning when importing a stabilized moduleMarc-André Lureau2020-07-191-7/+17
|
* find_program: Do not use fallback when before parsing project()Xavier Claessens2020-07-041-1/+1
| | | | | Mesa is doing `project(... find_program() ...)` so environment.wrap_resolver is not defined yet.
* qt: Fix has_tools() when required=FalseXavier Claessens2020-07-041-2/+6
| | | | | Improve logs by making it clear when the program is found but has wrong version.
* give user control of option skip_sanity_checkAlexander Neumann2020-07-041-4/+4
|
* interpreter: Don't abort if dep isn't required and sub didn't overrideXavier Claessens2020-07-011-2/+6
|
* interpreter: Already configured fallback should be used for optional depXavier Claessens2020-07-011-3/+5
|
* wrap: Refactor to split wraps dictionary into 3 separate dictsXavier Claessens2020-07-011-1/+1
| | | | | It makes the code cleaner to have 3 separate dictionaries for packagename, dependency and programs.
* find_program: Fallback if a wrap file provide the program nameXavier Claessens2020-07-011-25/+58
| | | | | | We don't need the legacy variable name system as for dependency() fallbacks because meson.override_find_program() is largely used already, so we can just rely on it.
* wrap: Do not fallback implicitly on optional dependencyXavier Claessens2020-07-011-2/+5
| | | | | | | | | | | | | This fix the following common pattern, we don't want to implicitly fallback on the first line: foo_dep = dependency('foo', required: false) if not foo_dep.found() foo_dep = cc.find_library('foo', required : false) if not foo_dep.found() foo_dep = dependency('foo', fallback: 'foo') endif endif
* wrap: Add 'provide' sectionXavier Claessens2020-07-011-8/+10
|
* Implicit dependency fallback when a subproject wrap or dir existsXavier Claessens2020-07-011-0/+8
|
* Merge pull request #7231 from mensinda/cmOverrideJussi Pakkanen2020-07-011-2/+10
|\ | | | | cmake: Add more advanced subproject configuration options
| * cmake: Add more advanced subproject configuration optionsDaniel Mensinger2020-06-051-2/+10
| | | | | | | | | | | | | | This is done with the new cmake subprojects options object that is similar to the already exisiting configuration data object. It is consumed by the new `options` kwarg of the cmake.subproject function.
* | interpreter: Allow dependecy or subproject name in force_fallback_forXavier Claessens2020-06-161-3/+6
| |
* | interpreter: Avoid new feature warning when using old has_exe_wrapper()Xavier Claessens2020-06-161-1/+4
| |
* | interpreter: add support for --force-fallback-forMathieu Duponchelle2020-06-161-2/+9
| | | | | | | | | | | | | | | | | | This new command line option allows specifying dependencies for which to force fallback. See the documentation for more information Fixes: #7218