summaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | Make use of unholderDylan Baker2020-03-051-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a lot of cases of code like: ```python if hasattr(var, 'held_object'): var = var.held_object` ``` replace that with the unholder function.
| * | | mesonlib: Replace unholder argument to listifyDylan Baker2020-03-051-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | listify shouldn't be unholdering, it's a function to turn scalar values into lists, or flatten lists. Having a separate function is clearer, easier to understand, and can be run recursively if necessary.
* | | | dependency: Verify fallback variable consistencyXavier Claessens2020-03-061-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This change made `5 dependency versions` unit test fail because now once a subproject has been configured, the fallback variable is checked to be consistent. So it has to use new subproject because 'somesub' was already configured by previous tests.
* | | | Improve logged messages for overriden dependenciesXavier Claessens2020-03-061-11/+17
| | | |
* | | | Allow override_dependency() with a not-found depXavier Claessens2020-03-061-0/+7
| | | |
* | | | Simplify dependency() fallbackXavier Claessens2020-03-061-13/+25
| | | | | | | | | | | | | | | | | | | | Now that subprojects can override the dependency name, there is no need to provide a variable name for the fallback any more.
* | | | Add meson.override_dependency()Xavier Claessens2020-03-061-17/+54
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to meson.override_find_program() but overrides the result of the dependency() function. Also ensure that dependency() always returns the same result when looking for the same dependency, this fixes cases where parts of the project could be using a system library and other parts use the library provided by a subproject.
* | | interpreter: add 'name' method to BuildTargetHolderStéphane Cerveau2020-03-041-0/+7
| | | | | | | | | | | | | | | | | | | | | As any child of BuildTargetHolder might need the name of the object, provides a method to get object name. This is useful in gst-build to display the plugin name and not the filename.
* | | review: Initial fixupDaniel Mensinger2020-03-021-5/+5
| | |
* | | types: (partially) annotate interpreterbase.pyDaniel Mensinger2020-03-021-14/+1
| | | | | | | | | | | | | | | | | | This commit annotates most of interpreterbase.py. However, there are stil the @wraps missing, since I am unsure what the types are supposed to be here.
* | | types: Annotate ast/interpreter.pyDaniel Mensinger2020-03-021-2/+1
| | |
* | | Merge pull request #6692 from xclaesse/summary-warningsJussi Pakkanen2020-03-011-20/+41
|\ \ \ | | | | | | | | Summary improvements
| * | | summary: Add more info in Subprojects sectionXavier Claessens2020-02-261-12/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a warnings counter for subprojects that passed. This is to encourage developpers to check warnings in the logs and hopefully fix them. Otherwise they could be hidden in hundreds lines of logs. This also print the error message for subprojects that did not pass. The error message is often enough to fix the issue (e.g. missing dependency) and it's easier than searching in the logs why a subproject failed.
| * | | summary: Add list_sep keyword argumentXavier Claessens2020-02-261-8/+13
| | |/ | |/| | | | | | | | | | This allows having lists on a single line instead of having each value aligned on a new line.
* | | Store filename in node locationJon Turney2020-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Warnings have a location node object (with subdir and lineno attributes), which is passed as a location: kwarg to mlog.warning() and formatted in _log_error(). Re-purpose the subdir attribute (path relative to the source root dir, with an implied filename of 'meson.build'), which is stored into the node by parser(), to contain a pathname. (Properly I should rename 'subdir' -> 'file' everywhere, but that's a lot of churn just to see if this works) Notes: The warning location node may also have a colno attribute, which is currently ignored by _log_error(). We can't currently issue warnings with locations in meson_options.txt because the filename isn't part of the location (as it's assumed to be 'meson.build).
* | | Adjust all the other places MesonException file attribute is setJon Turney2020-02-281-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | A MesonException has file, lineno and colno attributes, which get formatted as a location in mlog.exception(). The file attribute got changed from a path relative to the root source directory to a pathname (absolute or relative to cwd) in one place in commit b8fbbf59. Adjust all the other places the file attribute is set to match. Also: Setting MesonException.file seems to be missing in the case where Parser returned a non-CodeBlockNode object. Fortunately, that looks like it's unreachable, but add it just in case.
* | version parsing: match only when version starts with a numberGerion Entrup2020-02-171-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>
* | configure_file: Also copy timestamps to avoid useless rebuildsNirbheek Chauhan2020-02-111-1/+1
|/ | | | | If we always copy files over without timestamps, we're forcing a (probably unnecessary) rebuild. Also include a test for this.
* Make 'default_library' per-subproject builtin optionXavier Claessens2020-02-061-5/+8
| | | | | | | | | | Currently it's just like if all builtin/base/compiler options are yielding. This patch makes possible to have non-yielding builtin options. The value in is overriden in this order: - Value from parent project - Value from subproject's default_options if set - Value from subproject() default_options if set - Value from command line if set
* docMichael Hirsch, Ph.D2020-02-051-2/+2
|
* add get_external_property to replace get_cross_propertyMichael Hirsch, Ph.D2020-02-051-14/+29
|
* add meson.get_native_property for native filesMichael Hirsch, Ph.D2020-02-051-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | This allows Meson native-file [properties] to be used. This avoids the need to call meson from a script file or have a long command line invocation of `meson setup` The method meson.get_native_property('prop', 'fallback') is added. The native file can contain properties like ``` [properties] myprop1 = 'foo' mydir2 = 'lib/custom' ``` Then from within `meson.build` ```meson x1 = meson.get_native_property('myprop1') thedir = meson.get_native_property('mydir2', 'libs') ``` fallback values are optional
* interpreter: Iterate custom target outputsXavier Claessens2020-02-041-5/+22
|
* summary: Fix empty list caseXavier Claessens2020-02-011-0/+2
| | | | Fixes: #6557.
* mintro: use interpreter data for buildsystem-files (fixes #6390)Daniel Mensinger2020-01-281-0/+1
|
* backend: refactor: set self.interpreter in the constructorDaniel Mensinger2020-01-281-1/+1
|
* Merge pull request #6423 from dcbaker/declare-dependency-variablesJussi Pakkanen2020-01-271-2/+12
|\ | | | | Add ability to set and query arbitrary variables on declare_dependency objects
| * dependencies: Add ability to set arbitrary variables onDylan Baker2020-01-091-2/+12
| | | | | | | | | | | | | | | | | | | | | | declare_dependencies This allows dependencies declared in subprojects to set variables, and for those variables to be accessed via the get_variable method, just like those from pkg-config and cmake. This makes it easier to use projects from subprojects in a polymorphic manner, lowering the distinction between a subproject and an external dependency every further.
* | Support multiple args to message() and warning()Xavier Claessens2020-01-261-15/+15
| |
* | Fix required dependency() not failing when wrap-mode=nofallbackXavier Claessens2020-01-251-1/+5
| | | | | | | | | | | | When a dependency is required, not found on the system, and its fallback is disabled with --wrap-mode=nofallback, meson should abort instead of returning not-found.
* | Fix typo in error messageXavier Claessens2020-01-181-1/+1
|/
* types: import typing as T (fixes #6333)Daniel Mensinger2020-01-081-8/+8
|
* summary: Change 'section' to be a kwarg instead of positionalXavier Claessens2019-12-191-17/+8
| | | | Fixes: #6372.
* add compiler.get_linker_id() methodMichael Hirsch, Ph.D2019-12-191-0/+7
| | | | | | | | | | | | | | | this can be useful for if/elif where linker behaviors must be considered. For example, clang with "link" vs gcc with "ld.bfd" etc. ci for compiler.get_linker_id() method doc add @FeatureNew check Co-Authored-By: Daniel Mensinger <daniel@mensinger-ka.de>
* python: add embed to the python dependency functionDaniel Mensinger2019-12-181-0/+1
|
* summary: Add 'Subprojects' section to main projectXavier Claessens2019-12-121-4/+20
|
* summary: Add bool_yn keyword argumentXavier Claessens2019-12-121-6/+13
|
* summary: Allow section with no title, and passing key/value separatelyXavier Claessens2019-12-121-8/+24
|
* Add a summary() function for configuration summarizationXavier Claessens2019-12-121-2/+64
| | | | | | Based on patch from Dylan Baker. Fixes #757
* assert(): Make message argument optionalXavier Claessens2019-12-101-5/+15
|
* run_command: Do not add dependency on /dev/stdoutXavier Claessens2019-12-091-1/+1
| | | | | | | Blacklist /dev paths, this fix infinite reconfigure when /dev/stdout is redirected to a file. Fixes: #6315.
* find_program(): Add 'dirs' keyword argumentXavier Claessens2019-12-051-15/+26
| | | | Fixes: #1576
* interpreter: Remove useless checkXavier Claessens2019-12-051-2/+0
| | | | | extract_required_kwarg() above already ensure that required is always boolean at that point.
* lgtm: Actually supress the Non-standard exception warningDaniel Mensinger2019-12-051-4/+4
|
* lgtm: ignore Non-standard exception raised in special methodDaniel Mensinger2019-12-051-2/+2
|
* Revert "Have set() and set_quoted() of configuration object work with newlines."Xavier Claessens2019-11-281-1/+0
| | | | This reverts commit 6ed36e97aeb01dd779115a9710d3a97cdbcb4ccf.
* Fix crash when checking multi version on subproject depXavier Claessens2019-11-261-6/+7
| | | | Also harminize a bit the logged message.
* Simplify list of build def filesXavier Claessens2019-11-251-23/+27
| | | | | | | | | Refactor the code inside a common function for consistency. It's not needed to add dependencies in func_configure_file() because it's already done in run_command_impl(). Do it only for files from `input:` in the case some of them does not end up in the command arguments.
* Merge pull request #6199 from mensinda/cmSysIncJussi Pakkanen2019-11-201-0/+1
|\ | | | | cmake: Handle CMake system include dirs (closes #6079)
| * ci: Add CI command to include text files in the CI logDaniel Mensinger2019-11-191-0/+1
| |