aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
AgeCommit message (Collapse)AuthorFilesLines
2018-08-06Store global and project arguments separately for cross and native compilation.crossargfixJussi Pakkanen1-4/+17
2018-07-31custom targets: Add a 'console' kwarg for long-running commandsNirbheek Chauhan1-1/+2
Ninja buffers all commands and prints them only after they are complete. Because of this, long-running commands such as `cargo build` show no output at all and it's impossible to know if the command is merely taking too long or is stuck somewhere. To cater to such use-cases, Ninja has a 'pool' with depth 1 called 'console', and all processes in this pool have the following properties: 1. stdout is connected to the program, so output can be seen in real-time 2. The output of all other commands is buffered and displayed after a command in this pool finishes running 3. Commands in this pool are executed serially (normal commands continue to run in the background) This feature is available since Ninja v1.5 https://ninja-build.org/manual.html#_the_literal_console_literal_pool
2018-07-31Merge pull request #3850 from mesonbuild/nirbheek/exe-wrapper-compiler-fallbacksJussi Pakkanen1-3/+1
Be more permissive about not-found exe_wrapper
2018-07-25Add a feature-new entry for UserFeatureOptionNirbheek Chauhan1-5/+6
Since we can't detect it in meson_options.txt, detect it when the option is used.
2018-07-21Merge pull request #3893 from FFY00/masterJussi Pakkanen1-0/+6
Add dlang module (dub support)
2018-07-19Merge pull request #3814 from behlec/configure-file-outputJussi Pakkanen1-0/+9
Check if calls to configure_file write to the same output file.
2018-07-09cross: Use ExternalProgram for cross-file exe_wrapperNirbheek Chauhan1-3/+1
We already have code to fetch and find binaries specified in a cross file, so use the same code for exe_wrapper. This allows us to handle the same corner-cases that were fixed for other cross binaries.
2018-07-08Add missing method on external library object: type_name() (#3845)Nirbheek Chauhan1-0/+6
For some reason this was missing, but it should've always existed since cc.find_library() returns an object that is internally an ExternalDependency instance.
2018-07-08Use mlog.bold to add quotesChristoph Behle1-1/+1
2018-07-08Simplified and cleaned up warning.Christoph Behle1-4/+4
2018-07-07Consider subdir for output files.Christoph Behle1-3/+7
Files will only clash if in the same subdir. Print the subdir in the warning.
2018-07-07Track line numbers for configure_file.Christoph Behle1-2/+2
Track line numbers of calls. Warning reports now the line number of the first and the current write to the same file.
2018-07-07Add warning if configure_file overwrites output.Christoph Behle1-0/+5
Record the output for each call to configure_file. If a previous output is overwritten print a warning.
2018-07-07Print a more usable message when a subproject fails to configureNirbheek Chauhan1-3/+9
Instead of just printing the message in the exception, if it's a MesonException, also print the file and the line number. If it's an unknown exception, print the entire traceback so that we can pin-point what the Meson bug causing it is.
2018-07-07Raise a MesonException when substituting an invalid valueNirbheek Chauhan1-2/+8
Avoids throwing a traceback. Also, warn when setting such a value.
2018-07-07Add new method: mlog.deprecation()Nirbheek Chauhan1-2/+1
Instead of constructing it manually, use a helper.
2018-07-06mlog: Add built-in support for quoting bolded messagesNirbheek Chauhan1-20/+22
This allows us to drop wonky sep='' hacks and manual addition of spaces across the codebase.
2018-07-04configure_file: Don't optimize away substitutionsNirbheek Chauhan1-18/+10
It's possible that the configuration data object has components added conditionally, and that sometimes an empty configuration data object is passed on purpose. Instead, we do the substitution and also warn if no tokens were found that could've been substituted. Closes https://github.com/mesonbuild/meson/issues/3826
2018-07-02Contributing.md: Document procedure for new features [skip ci]Nirbheek Chauhan1-1/+1
2018-07-02FeatureNew: Make all checks subproject-specificNirbheek Chauhan1-34/+54
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-07-02interpreter: Use is_subproject() everywhereNirbheek Chauhan1-3/+3
2018-07-02FeatureNew: Fix method names for some feature checksNirbheek Chauhan1-10/+10
2018-07-02Various bug fixes for FeatureNewSalamandar1-0/+9
* Use _get_callee_args to unwrap function call arguments, needed for module functions. * Move some FeatureNewKwargs from build.py to interpreter.py * Print a summary for featurenew only if conflicts were found. The summary now only prints conflicting features. * Report and store featurenew/featuredeprecated only once * Fix version comparison: use le/ge and resize arrays to not fail on '0.47.0>=0.47' Closes https://github.com/mesonbuild/meson/issues/3660
2018-07-01Proper error message for non-found exe in run_target. Closes #3818Jussi Pakkanen1-0/+2
2018-07-01Add a helper for fetching of binaries from cross filesNirbheek Chauhan1-11/+6
A number of cases have to be taken care of while doing this, so refactor it into a helper on ExternalProgram and use it everywhere. 1. Command is a list of len > 1, use it as-is 2. Command is a list of len == 1 (or a string), use as a string 3. If command is an absolute path, use it as-is 4. If command is not an absolute path, search for it
2018-07-01Allow command lists for find_program cross file overridesNirbheek Chauhan1-2/+6
This is accepted by all other binaries in the cross file. With this change, we also don't check whether the specified command exists at configure time, but that's probably a feature anyway. Fixes https://github.com/mesonbuild/meson/issues/3737
2018-06-30Improve logging when dependency is anonymousJon Turney1-8/+10
Various pieces of logging assume the dependency has a name, and aren't grammatical if the dependency is '', so say it is anonymous instead.
2018-06-30More tests to cover missing fallback for a non-found dependencyJon Turney1-1/+3
Fix logic so we correctly raise an exception about missing fallback in the case where the dependency is required.
2018-06-30Fix handling of dependency('', fallback: ['subproject', 'dep'])Jon Turney1-8/+8
Also extend a test case to cover this.
2018-06-30Warn if using Clang+asan+b_lundef. Closes #764.Jussi Pakkanen1-0/+19
2018-06-21Print default option values that don't match the current valueNiklas Claesson1-2/+16
2018-06-20Rename clike_langs to clink_langs for clarityNirbheek Chauhan1-2/+2
D is not a 'c-like' language, but it can link to C libraries. The same might be true of Rust in the future and Go when we add support for it. This contains no functionality changes.
2018-06-18Make a custom target output dir as an include dir relative to @BUILD_ROOT@Jon Turney1-1/+1
Make a custom target output dir as an include dir relative to @BUILD_ROOT@, so that path is constructed correctly when using the absolute path forms used by the MSVC backend.
2018-06-18Make depends: of windows.compile_resources() include-ableJon Turney1-0/+4
Add the output directories for any custom target in depends: to the resource compiler include path
2018-06-18run_command: Add new kwarg 'capture'Nirbheek Chauhan1-8/+17
capture: false means we won't try to read the stdout at all. Closes https://github.com/mesonbuild/meson/issues/3364
2018-06-18Deprecate `build_always`, add `build_always_stale`Alex Hirsch1-3/+4
Since `build_always` also adds a target to the set of default targets, this option is marked deprecated in favour of the new option `build_always_stale`. `build_always_stale` *only* marks the target to be always considered out of date, but does *not* add it to the set of default targets. The old behaviour can still be achieved by combining `build_always_stale` with `build_by_default`. fixes #1942
2018-06-18Add check for arguments of has_members.Christoph Behle1-0/+2
Ensure that has_members has at least two arguments.
2018-06-18Use stub to report misuse of get_defineChristoph Behle1-4/+1
Instead of checking on the call site add a stub to Compiler which raises an exception.
2018-06-18Test if compiler supports get_define.Christoph Behle1-1/+4
Raise an InterpreterError for a clean error message if get_define is not supported by the compiler.
2018-06-18Add UserFeatureOption typeXavier Claessens1-25/+103
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-17dependencies: add dub as a dependency methodFFY001-0/+6
2018-06-12Always apply concatenate_string_literal.Christoph Behle1-4/+0
get_define always applies concatenate_string_literal to its result. Remove kwarg concatenate_string_literal from get_define.
2018-06-12get_define can concatenate string literals.Christoph Behle1-0/+4
Added method concatenate_string_literals to CCompiler. Will concatenate string literals. Added keyword argument 'concatenate_string_literals' to Compiler.get_define. If used will apply concatenate_string_literals to its return value.
2018-06-10configure_file: Add 'encoding' to FeatureNewNirbheek Chauhan1-1/+1
2018-06-09Add file encoding to configure_fileSander Sweers1-3/+6
Input files can be in any file encoding, not just utf-8 or isolatin1. Meson should not make assumptions here and allow for the user to specify the encoding to use.
2018-06-09Fix options being reset to default on reconfigureXavier Claessens1-4/+14
Closes: #3712
2018-06-07Interpreter: Fix subdir_done() to exit from inside if/foreach blocksXavier Claessens1-1/+4
Closes: #3700.
2018-06-06Convert args.projectoptions into a dictXavier Claessens1-80/+62
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-06coredata: Stop setting default option values as argparse attributeXavier Claessens1-12/+11
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-06Move to coredata some methods handling optionsXavier Claessens1-1/+1
Those methods only use coredata object, so better just move them as a coredata method.