aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/optinterpreter.py
AgeCommit message (Collapse)AuthorFilesLines
2020-09-22pylint: turn on bad-indentation errorDylan Baker1-1/+1
and fix all of the bad indentation
2020-09-08typing: more fixesDaniel Mensinger1-6/+5
2020-08-04Capitalize some constants in coredataJohn Ericson1-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.
2020-05-26opts: Add FeatureNew for '-' and 'not' introduced in 0.54.1Daniel Mensinger1-0/+2
2020-05-26opts: Allow string concatenation (fixes #7199)Daniel Mensinger1-0/+7
2020-05-14optinterpreter: Enable and update FeatureNew to use_singleDylan Baker1-7/+5
With the version information fixed we can use a FeatureNew inside the optinterpreter, so let's do it.
2020-04-11opts: Allow `-` and `not` in meson_options.txt (fixes #6948)Daniel Mensinger1-0/+10
2020-03-02types: Annotate mparser.pyDaniel Mensinger1-2/+2
This also fixes that the keys in ArgumentNode.kwargs are all of the type BaseNode now. Before this commit, it was possible that both strings and Nodes where used as keys.
2020-02-28Store filename in node locationJon Turney1-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).
2020-02-28Adjust all the other places MesonException file attribute is setJon Turney1-2/+3
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.
2020-02-12Refactor UserIntegerOption to work with BuiltinOption.Jussi Pakkanen1-3/+2
2020-01-08types: import typing as T (fixes #6333)Daniel Mensinger1-2/+2
2019-07-15No need to reserve build_ because we use build. instead.Jussi Pakkanen1-1/+1
2019-05-20Reserve build_ prefix in option names.Jussi Pakkanen1-1/+1
2019-05-15UserOption no longer has a name field.John Ericson1-19/+15
This avoids the duplication where the option is stored in a dict at its name, and also contains its own name. In general, the maxim in programming is things shouldn't know their own name, so removed the name field just leaving the option's position in the dictionary as its name.
2019-04-05optinterpreter: Add a log argument to is_invalid_nameDylan Baker1-3/+4
Since we're adding arguments that use the cross_ prefix but are valid we don't want to print "warning invalid argument name!", as that will confuse people by virtue of being wrong.
2019-04-05optinterpreter: Add type annotations to is_invalid_nameDylan Baker1-1/+1
2019-04-04coredata: remove get_builtin_optionsDylan Baker1-1/+1
This returns a list out of th keys of a dict. In both cases of use remaining though it's used for checking membership, checking for list membership, lists are O(n) lookup, while dicts are O(1), so removing the abstraction reduces typing and improves performance.
2019-03-19Reserve cross_ option prefix for Meson.Jussi Pakkanen1-0/+4
2018-07-25UserFeatureOption: Default to 'auto' when no value specifiedXavier Claessens1-1/+1
Closes #3938.
2018-07-02FeatureNew: Make all checks subproject-specificNirbheek Chauhan1-4/+8
We now pass the current subproject to every FeatureNew and FeatureDeprecated call. This requires a bunch of rework to: 1. Ensure that we have access to the subproject in the list of arguments when used as a decorator (see _get_callee_args). 2. Pass the subproject to .use() when it's called manually. 3. We also can't do feature checks for new features in meson_options.txt because that's parsed before we know the meson_version from project()
2018-06-18Add UserFeatureOption typeXavier Claessens1-0/+8
This is a special type of option to be passed to most 'required' keyword arguments. It adds a 3rd state to the traditional boolean value to cause those methods to always return not-found even if the dependency could be found. Since integrators doesn't want enabled features to be a surprise there is a global option "auto_features" to enable or disable all automatic features.
2018-06-06Convert args.projectoptions into a dictXavier Claessens1-44/+1
This simplifies a lot of code, and centralize "key=value" parsing in a single place. Unknown command line options becomes an hard error instead of merely printing warning message. It has been warning it would become an hard error for a while now. This has exceptions though, any unknown option starting with "<lang>_" or "b_" are ignored because they depend on which languages gets added and which compiler gets selected. Also any option for unknown subproject are ignored because they depend on which subproject actually gets built. Also write more command line parsing tests. "19 bad command line options" is removed because bad cmd line option became hard error and it's covered with new tests in "30 command line".
2018-06-06optinterpreter: Remove duplicated list of languagesXavier Claessens1-13/+2
It is important to keep the list of languages up to date in optinterpreter, otherwise we could have conflicting options when adding new languages.
2018-06-01Add 0.45.0 featuresSalamandar1-0/+4
2018-06-01Add 0.44.0 featuresSalamandar1-1/+2
2018-03-20options: s/yiel/yield/ typoThibault Saunier1-1/+1
Making the option unusable with Invalid kwargs for option use_orc: "yield"
2018-02-16Fix subproject prefix handling when checking subproject option validity.Hemmo Nieminen1-8/+25
2018-02-08User options can "yield to" a user option of the same name in superproject. ↵Jussi Pakkanen1-11/+26
Closes ##2853.
2018-02-07Expose integer options to build option files.Jussi Pakkanen1-0/+11
2017-12-19Warn on unknown command line argumentsDylan Baker1-0/+9
I have a tendency to typo things. Humans in general are bad at spotting spelling mistakes, computers are not. This patches prints the bad options and provides the generic meson "This will be a hard error someday" message.
2017-12-07Renamed UserStringArrayOption to UserArrayOption for short.Jussi Pakkanen1-1/+1
2017-12-03String arguments can permit arbitrary string valuesJussi Pakkanen1-9/+11
by leaving out the choices keyword.
2017-11-29Add new array type optionDylan Baker1-0/+16
This exposes the already existing UserStringArrayOption class through the meson_options.txt. The intention is to provide a way for projects to take list/array type arguments and validate that all of the elements in that array are valid without using complex looping constructrs.
2017-11-06coredata: Remove parse_string() methodXavier Claessens1-1/+1
set_value() already does a better job at parsing strings, such as accepting "True" for a boolean. This fixes issue #2544
2017-10-04options: Add a permitted_kwargs functionDylan Baker1-3/+24
I've typo'd "value" for the last time, options needs a kwargs validator. This validator is slightly different than the one used by the main parser, since it operates on a much simpler representation than the other one does, and they are not interchangeable. This also changes the optinterpreter to use pop on 'type' and 'description' so that they're not passed to the validator as kwargs.
2017-08-05Add option to limit maximum number of concurrent link processes.Jussi Pakkanen1-11/+12
2017-04-04Allow option values to contain ':'Nirbheek Chauhan1-3/+4
Instead, check that option keys don't contain ':'. Also change the failing option test to look for this. Closes https://github.com/mesonbuild/meson/issues/1454
2017-01-18cleanup: Remove redundant parenthesesMike Sinkovsky1-1/+1
2017-01-03Merge pull request #1260 from mesonbuild/subproj_defaultsJussi Pakkanen1-0/+7
Can set subproject option defaults from command line and master project
2017-01-01style: fix E124 violationsIgor Gnatenko1-1/+1
E124: closing bracket does not match visual indentation Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-31Fix space before :.Jussi Pakkanen1-3/+3
2016-12-29Can set project options (but not global options) in subproject default options.Jussi Pakkanen1-0/+7
2016-12-21Raise clearer error if -Doption is invalid.Elliott Sales de Andrade1-1/+4
2016-12-19tree-wide: use proper 'not in' notationIgor Gnatenko1-1/+1
Let's be more pythonic and 'not is' seems really weird. Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-04Store subdir information for each node so we can remove files set in other ↵Jussi Pakkanen1-1/+1
subdirectories.
2016-08-27Use context manager for file I/O.Elliott Sales de Andrade1-1/+2
There are a few cases where a context manager cannot be used, such as the logger.
2016-08-27Flatten isinstance calls. (#715)Elliott Sales de Andrade1-5/+2
That is, isinstance(x, y) or isinstance(x, z) can be flattened with a tuple to isinstance(x, (y, z)).
2016-08-19Implement D supportMatthias Klumpp1-0/+1
This patch adds support for the D programming language[1] to Meson. The following compilers are supported: * LDC * GDC * DMD [1]: http://dlang.org/
2016-04-04coredata: Centralize builtin option descriptions and definitions.Hemmo Nieminen1-1/+1