Commit Graph

190 Commits

Author SHA1 Message Date
Nicolas Schneider 3232f780d8 use same code for printing options in mconf and msetup
Also, options are now responsible for providing a suitable printable
representation of their value instead of handling this at the caller.
2019-01-06 19:41:24 -05:00
Nicolas Schneider 735e138382 fix meson configure exception when install_umask is not an int 2019-01-06 22:35:04 +02:00
John Ericson e147054d6f Get rid of `ConfigData` 2019-01-02 16:22:47 -05:00
Daniel Mensinger 10ce5deb71
Introspection refactoring 2018-12-29 23:55:45 +01:00
Jussi Pakkanen da5da5977a Default libdir is "lib" when cross compiling. Closes #2535. 2018-12-30 00:51:19 +02:00
John Ericson 9b13fb3672 Factor out more option iterating 2018-12-20 23:01:36 +02:00
John Ericson 4ffd009fe9 Factor out iterator over options dictionaries
Otherwise it's easy to forget one. In fact we did forget one:
`backend_options` in `validate_option_value`.
2018-12-18 20:40:24 +02:00
Jussi Pakkanen 6124a97722 Bump version number for new development. 2018-12-10 00:33:03 +02:00
Jussi Pakkanen 51aaa15bda Update everything for release 0.49.0 2018-12-09 21:58:12 +02:00
John Ericson 0fd548e16f Combine `run_tests` import lines in `run_unittests` 2018-12-03 22:33:20 +02:00
Dylan Baker 3af4407a16 Get basic native config file loading working 2018-11-14 15:57:37 -08:00
Xavier Claessens 8aeb967773 coredata: Do not use ':' as key delimited in cmd_line.txt 2018-11-09 20:32:52 -05:00
Xavier Claessens 43101489cd Recover when coredata cannot be loaded
Write command line options into a separate file to be able to
reconfigure from scatch in the case coredata cannot be loaded. The most
common case is when we are reconfiguring with a newer meson version.

This means that we should try as much as possible to maintain backward
compatibility for the cmd_line.txt file format.

The main difference with a normal reconfigure is it will use new
default options values and will read again environment variables like
CFLAGS, etc.
2018-11-06 16:37:13 -05:00
Jussi Pakkanen 4d986563dc Expose wrap_mode as an option. Closes #4266. 2018-10-07 22:52:54 +03:00
Jussi Pakkanen 3c4822e183 Updated version number for new development. 2018-09-22 23:36:09 +03:00
Jussi Pakkanen d1f3f1d023 Bump version number for release. 2018-09-22 20:21:49 +03:00
Zbigniew Jędrzejewski-Szmek 06646fe772 Drop unnecessary periods from help strings
The ones for "Compiler options" have no dots, so this was inconsistent.
Also dropping the dots makes the text fit better on narrow terminals.
2018-09-18 21:49:34 +03:00
Jussi Pakkanen 3f51745b41 New numbering scheme for pre-release versions. [skip ci] 2018-09-13 22:20:48 +03:00
Xavier Claessens 05cab3dee5 Set wrap_mode to None by default to know if user passed a value 2018-08-22 15:15:54 -04:00
Xavier Claessens 576f3bb1bf UserArrayOption: Allow duplicates when used as <lang>_args option
Closes: #4021.
2018-08-20 16:16:38 -04:00
Jussi Pakkanen d83f77109a
Convert buildtype to optimization and debug options (#3489) 2018-08-18 20:39:47 +03:00
Jussi Pakkanen 7bb5f82736 Added install target to VS. Closes #3841. 2018-07-22 16:05:09 +03:00
Nirbheek Chauhan 4fb00ee1d8 Add new method: mlog.deprecation()
Instead of constructing it manually, use a helper.
2018-07-07 04:33:24 -07:00
Jon Turney b387ab1ee1 Fix flake8 issues (#3834)
* Fix flake8 whitespace reports

$ flake8 | grep -E '(E203|E221|E226|E303|W291|W293)'
./mesonbuild/coredata.py:337:5: E303 too many blank lines (2)

* Fix flake8 'variable assigned value but unused' reports

$ flake8 | grep -E F841
./mesonbuild/modules/gnome.py:922:9: F841 local variable 'target_name' is assigned to but never used

* Fix flake8 'imported but unused' reports

$ flake8 | grep F401
./mesonbuild/compilers/__init__.py:128:1: F401 '.c.ArmclangCCompiler' imported but unused
./mesonbuild/compilers/__init__.py:138:1: F401 '.cpp.ArmclangCPPCompiler' imported but unused
./mesonbuild/modules/__init__.py:4:1: F401 '..mlog' imported but unused

PR #3717 imports ARMCLANG compilers in __init__, but does not add them to
__all__, so they are not re-exported by the compilers package like
everything else.

* More details about flake8 in Contributing.md

Mention that Sider runs flake8
Suggest seting flake8 as a pre-commit hook
2018-07-05 18:08:04 +00:00
Jussi Pakkanen 36fbb48b43 Bump version number for new development. [skip ci] 2018-07-02 22:19:32 +03:00
Jussi Pakkanen 5d08219464 Update everything for new release. 2018-07-02 20:50:56 +03:00
Dylan Baker f3a8f9c34d Options: treat array option -Dopt= and -Dopt=[] as equivalent
Currently the former will be parsed as [''], while the latter is parsed
as [] in python. This makes for some obnoxious special handling
depending on what the user passes. This is even more obnoxious since for
string type arguments this doesn't require special handling.
2018-06-29 10:56:25 +00:00
Xavier Claessens 99dd5f34de Downgrade unknown option from exception to warning
It used to be non-fatal warnings but recent command line refactor made
it fatal. It looks like GNOME continuous would break with this change.
To avoid delaying upcoming 0.47.0 release adoption, let's downgrade this
back to warning for now and reconsider after the release.
2018-06-19 20:29:57 +00:00
Xavier Claessens e565945253 Add UserFeatureOption type
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-18 04:57:32 +00:00
Niklas Claesson 14716ea90c Visual Studio: Implement startup project 2018-06-10 23:36:54 +03:00
Jon Turney 2e34024a05 Refine cross file checking to ignore directories
e.g. 'meson x86_64-w64-mingw32 --cross-file x86_64-w64-mingw32' currently
fails with an IsADirectoryError exception.

Cross files must be files, so when searching, only accept a candidate path
which is an existing file, not just an existing path.
2018-06-09 17:27:07 +03:00
Xavier Claessens 7c4736d27f Convert args.projectoptions into a dict
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-06 20:02:37 +00:00
Xavier Claessens 75e501ceb8 coredata: Stop setting default option values as argparse attribute
All options are now the projectoptions list, regardless of how they got
defined in the command line.

This also delays setting builtin option values until the main project()
default options are parsed to simplify the code. This is possible
because we already delayed setting the backend after parsing main
project() in a previous commit.
2018-06-06 20:02:37 +00:00
Xavier Claessens af66656117 UserUmaskOption: Add 'preserve' in choices and use octal notation 2018-06-06 20:02:37 +00:00
Xavier Claessens 531722229b UserUmaskOption: Implement validate_value instead of set_value
set_value() is implemented by the base class, subclasses only need to
override validate_value().
2018-06-06 20:02:37 +00:00
Xavier Claessens da29e48d13 mconf: Set prefix first because other options depends on it 2018-06-06 20:02:37 +00:00
Xavier Claessens d503b1423e mconf: Report all unknown cmd line options instead of aborting on first
This is also more consistent with the error message returned by
optinterpreter when it finds unknown command line options.
2018-06-06 20:02:37 +00:00
Xavier Claessens 8fb72510c3 Move to coredata some methods handling options
Those methods only use coredata object, so better just move them as a
coredata method.
2018-06-06 20:02:37 +00:00
Xavier Claessens 5af98d16b9 Delay backend creation until project() is parsed
The project() function could have a different value for the backend
option in its default_options kwargs.

Also set backend options, passing them in command line had no effect
previously.
2018-06-06 20:02:37 +00:00
Xavier Claessens b7d442150d Move <lang>_args to coredata.compiler_options 2018-06-06 20:02:37 +00:00
Xavier Claessens 58a9555ddf UserArrayOption: Small cleanup in value parsing
It is nicer to early raise exception if the value from meson_options.txt
is not a string in "[]" format than duplicating the parser code for both
cases.

Also it was checking for duplicated items only in the user_input case,
but we should also check for dups in the default value from
meson_options.txt.
2018-06-06 20:02:37 +00:00
Xavier Claessens 64bfc6cf7b UserArrayOption: Add support for splitting on space instead of coma 2018-06-06 20:02:37 +00:00
Jussi Pakkanen e3be7f7021 Write coredata transactionally. Closes #3511. 2018-05-21 00:48:25 +03:00
Xavier Claessens 570c108635 Fix --warnlevel being renamed to --warning-level in latest release 2018-04-27 11:09:14 -04:00
Xavier Claessens cb5ad2f211 Remove duplicated definition of -D cmdline arg 2018-04-26 22:46:40 -04:00
Jussi Pakkanen 9b0453d3e9
Merge pull request #3225 from filbranden/fixperms3
Introduce install_umask to determine permissions of files in install tree. Default it to 022
2018-04-26 23:14:00 +03:00
Jussi Pakkanen 9c073620aa
Merge pull request #3372 from NickeZ/vs-sol-folders
Use visual studio solution directories
2018-04-26 00:47:11 +03:00
Jussi Pakkanen d2f8f7e312 Bump version number for new development. [skip ci] 2018-04-23 23:11:34 +03:00
Jussi Pakkanen ade59f987f Updated version number for new release. 2018-04-23 03:24:26 +03:00
Filipe Brandenburger b0382733d8 Update default of install-umask to 022
And, with that, update the test cases that checked that preserving the
original permissions worked to set install_umask=preserve explicitly in
those projects' default_options.

Tested: ./run_tests.py
2018-04-18 11:44:54 -07:00