summaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Inline check_compilersJohn Ericson2019-03-241-1/+5
| | | | | | | | | | This function is used just once. It also seems all policy and no mechanism (it raises, it calls the same function to do all the work twice in a simple way). This makes it seem to be as a good candidate for inlining. `environment` and `coredata` are woefully intertwined and while this change doesn't fix that, but at least it makes it easier to follow.
* Disallow add_languages('vala') without 'c'Jon Turney2019-03-221-4/+6
| | | | | v2: Exercise add_lanagues('vala') after 'c' in a test case
* Merge pull request #5031 from bonzini/kconfigJussi Pakkanen2019-03-201-0/+3
|\ | | | | Kconfig Module
| * interpreter: allow passing dictionaries to holderifyPaolo Bonzini2019-03-151-0/+3
| | | | | | | | | | This in turn allows modules to return dictionaries, since their return values is automatically passed through holderify.
* | replace library type strings with an enumDylan Baker2019-03-201-2/+2
|/ | | | | | | This patch creates an enum for selecting libtype as static, shared, prefer-static, or prefer-shared. This also renames 'static-shared' with 'prefer_static' and 'shared-static' with 'prefer_shared'. This is just a refactor with no behavioral changes or user facing changes.
* Add static as keyword to find_libraryNiklas Claesson2019-03-111-2/+10
|
* Install header\'s subdir must not be absolute.Jussi Pakkanen2019-03-041-0/+2
|
* mtest: implement TAP parsingPaolo Bonzini2019-03-021-2/+2
| | | | | | | | | | | | | | | | This provides an initial support for parsing TAP output. It detects failures and skipped tests without relying on exit code, as well as early termination of the test due to an error or a crash. For now, subtests are not recorded in the TestRun object. However, because the TAP output goes on stdout, it is printed by --print-errorlogs when a test does not behave as expected. Handling subtests as TestRuns, and serializing them to JSON, can be added later. The parser was written specifically for Meson, and comes with its own test suite. Fixes #2923.
* interpreter: add "protocol" kwarg to testPaolo Bonzini2019-03-021-3/+8
| | | | This is the first step towards adding support for TAP.
* Move some configuration classes out of environment.pyJohn Ericson2019-02-271-1/+1
| | | | | | | | | | | First of all, I'd like compilers and other modules that environment.py currently imports to be able to take these without creating hard-to-follow module cycles. Second of all, environment.py's exact purpose seems a bit obscured. Splitting the data types (and basic pure functions) from the more complex logic that infers that data seems like a good way to separate concerns.
* Fall back to current interpreter when python3 not found.Jussi Pakkanen2019-02-261-0/+3
|
* Fix cross static linker lookupJohn Ericson2019-02-141-1/+1
| | | | | | Need to search based off of `cross_comp`, not `comp`. Fixes #4822
* allow setting directory locations in a native fileDylan Baker2019-02-111-3/+1
| | | | | | This allows the person running configure (either a developer, user, or distro maintainer) to keep a configuration of where various kinds of files should end up.
* Never access environment.properties downstreamJohn Ericson2019-02-021-3/+10
| | | | | | | | | | | | | | | | | Instead use coredata.compiler_options.<machine>. This brings the cross and native code paths closer together, since both now use that. Command line options are interpreted just as before, for backwards compatibility. This does introduce some funny conditionals. In the future, I'd like to change the interpretation of command line options so - The logic is cross-agnostic, i.e. there are no conditions affected by `is_cross_build()`. - Compiler args for both the build and host machines can always be controlled by the command line. - Compiler args for both machines can always be controlled separately.
* CMake: Added support for CMAKE_MODULE_PATH and extra CMake args (closes #4779)Daniel Mensinger2019-02-011-1/+3
|
* configure_file: Allow setting install_dir: false with deprecationNirbheek Chauhan2019-01-311-2/+7
| | | | | | Also add location node for two more deprecations See: https://github.com/mesonbuild/meson/pull/4489#issuecomment-459246879
* pep8 py37Michael Hirsch, Ph.D2019-01-291-1/+1
|
* fix non-default option printingNicolas Schneider2019-01-271-3/+4
| | | | | | | | Previously, the default option string was compared to the actual project option that has been converted to the proper type. This lead to messages like 'Option x is: true [default: true]'. Fixes #4806.
* run_command: add env kwargJan Tojnar2019-01-271-11/+15
|
* Interpreter: Add a location to all mlog.warning() callsXavier Claessens2019-01-221-8/+13
| | | | | | Now that the current node is always available as self.current_node in both function and method calls, it's easy to pass it to warning messages.
* Interpreter: Add current_node to 'state' passed to module methodsXavier Claessens2019-01-221-1/+2
| | | | The current node is useful to pass as location to mlog.warning().
* mintro: Introspection interpreter refactoring (#4733)Daniel Mensinger2019-01-161-49/+2
| | | | | | | | | | | | | | | | | | | | | | | * Fixed spelling * Merged the Buildoptions and Projectinfo interpreter * Moved detect_compilers to Environment * Added removed test case * Split detect_compilers and moved even more code into Environment * Moved set_default_options to coredata * Small code simplification in mintro.run * Move cmd_line_options back to `environment` We don't actually wish to persist something this unstructured, so we shouldn't make it a field on `coredata`. It would also be data denormalization since the information we already store in coredata depends on the CLI args.
* Fix flake8 errorsXavier Claessens2019-01-161-2/+1
|
* do_subproject: Improve log messages and formattingXavier Claessens2019-01-161-23/+25
|
* extract_required_kwarg: Fix typoXavier Claessens2019-01-161-1/+1
|
* dependency: Cleanup code by avoiding nested if blocksXavier Claessens2019-01-161-35/+29
|
* dependency: Not all DependencyException means not-found depXavier Claessens2019-01-161-4/+3
|
* dependency: Add has_fallback variableXavier Claessens2019-01-161-5/+6
|
* dependency_fallback: Set 'required' in subproject's kwargsXavier Claessens2019-01-161-16/+11
| | | | | This makes error clearer because it stops exactly where the error occurs during the subproject configuration.
* dependency_fallback: Pass display_name in argumentsXavier Claessens2019-01-161-3/+2
|
* do_subproject: InvalidCode is always an errorXavier Claessens2019-01-161-19/+5
| | | | | | | Not need to catch exceptions in dependency_fallback(), it's already handled in do_subproject(). This ensure subproject errors are handled the same way when doing dependency() fallback and when doing subproject().
* dependency_fallback: Simplify useless try blockXavier Claessens2019-01-161-5/+1
|
* dependencies: Avoid duplicated codeXavier Claessens2019-01-161-57/+30
| | | | | The dependency version from a subproject was checked in two different places. Do it in get_subproject_dep().
* dependencies: Remove version from cache keyXavier Claessens2019-01-161-21/+17
| | | | | We cannot have 2 different versions with all other kwargs being identical. This simplifies a lot that code.
* Build class should not duplicate compiler stateJohn Ericson2019-01-141-2/+2
| | | | | Compilers should be held by coredata, so this is just here for convenience.
* interpreter: obey to the install argument in configure_fileMarco Trevisan (Treviño)2019-01-131-2/+12
| | | | | | | | | | | If a configure_file has an install_dir set, the supported install argument is ignored, while this should have actually higher priority than the install_dir itself. Also check that correct types are used for `install` and `install_dir`. Add test to verify this. Fixes #3983
* Fix a typo in an error messageJon Turney2019-01-111-1/+1
|
* Remove spurious case in interpreterJohn Ericson2019-01-101-2/+0
| | | | | `need_cross_compiler = is_cross_build()`, so the condition is always false.
* use same code for printing options in mconf and msetupNicolas Schneider2019-01-061-1/+1
| | | | | Also, options are now responsible for providing a suitable printable representation of their value instead of handling this at the caller.
* Always flatten include_directories listsXavier Claessens2019-01-061-8/+6
|
* Remove cross_info; cross file is parsed up front and discardedJohn Ericson2019-01-021-21/+12
|
* Get rid of `need_cross_compiler`John Ericson2019-01-021-1/+1
| | | | | | | | | | Building a cross compiler (`build == host != target`) is not cross compiling. As such, it doesn't make sense to handle it under `is_cross_build`. (N.B. Building a standard library for a cross compiler would require cross compiling, but Meson has support to do such a thing as part of a compiler build currently.)
* Can use plain strings for include_directories.Jussi Pakkanen2019-01-021-1/+16
|
* Introspection refactoringDaniel Mensinger2018-12-291-98/+12
|
* Print warning if using "default_options" without a "fallback".Jussi Pakkanen2018-12-301-0/+2
|
* find_library: Add 'has_headers' kwargXavier Claessens2018-12-271-33/+37
| | | | | A library without its headers is often useless, so it is common to check them together.
* Add 'required' kwarg in header check functionsXavier Claessens2018-12-241-5/+29
| | | | Closes: #3940
* Can specify a string to print when dep not found. Closes #2407.Jussi Pakkanen2018-12-221-0/+18
|
* Reformat long lines.Jussi Pakkanen2018-12-221-4/+48
|
* Factor out more option iteratingJohn Ericson2018-12-201-4/+1
|