summaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed subprojects build infoDaniel Mensinger2018-12-191-1/+1
|
* Allow fallback in nodownload modeXavier Claessens2018-12-191-1/+1
| | | | | | It is possible that the subproject has been downloaded already, in that case there is no reason to not use it. If the subproject has not been downlaoded already it will fail do_subproject().
* Merge pull request #3061 from jon-turney/introspect-custom-target-filesJussi Pakkanen2018-11-281-1/+7
|\ | | | | Fix 'meson introspect --target-files' for a custom target
| * Tolerate custom target sources which can't be converted to FilesJon Turney2018-09-151-1/+5
| | | | | | | | | | For backwards compatibility, tolerate but warn about custom target sources which can't be converted to Files
| * Convert custom target sources to Files with self.source_strings_to_files.Jussi Pakkanen2018-09-151-1/+3
| |
* | interpreter: allow find_program to use the native fileDylan Baker2018-11-141-4/+15
| |
* | replace ExternalProgram.from_cross_info with from_bin_listDylan Baker2018-11-141-1/+1
| | | | | | | | | | This more generic method will also be used to check a config file for binary information.
* | compilers: Use keyword only arguments for compiler interfacesDylan Baker2018-11-131-14/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because we need to inherit them in some cases, and python's keyword-or-positional arguments make this really painful, especially with inheritance. They do this in two ways: 1) If you want to intercept the arguments you need to check for both a keyword and a positional argument, because you could get either. Then you need to make sure that you only pass one of those down to the next layer. 2) After you do that, if the layer below you decides to do the same thing, but uses the other form (you used keyword by the lower level uses positional or vice versa), then you'll get a TypeError since two layers down got the argument as both a positional and a keyword. All of this is bad. Fortunately python 3.x provides a mechanism to solve this, keyword only arguments. These arguments cannot be based positionally, the interpreter will give us an error in that case. I have made a best effort to do this correctly, and I've verified it with GCC, Clang, ICC, and MSVC, but there are other compilers like Arm and Elbrus that I don't have access to.
* | Add kwarg is_default to add_test_setup()Stian Selnes2018-11-121-0/+8
| | | | | | | | | | | | | | is_default may be used to set the name of the test setup that will be used by default whenever the option --setup is not given. Fixes #4430
* | Only add link arguments when needed in Compiler object methodsJon Turney2018-11-041-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, ComplierHolder.determine_args() unconditionally adds the link arguments to the commmand, even if we aren't linking, because it doesn't have access to the mode (preprocess, compile, link) that _get_compiler_check_args() will use. This leads to command lines like: 'cl testfile.c /nologo /showIncludes /c /Fooutput.obj /Od kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib' which clang-cl considers invalid; MSVS cl accepts this, ignoring the unneeded libraries Change from passing extra_args down to _get_compiler_check_args(), to passing down a callback to CompilerHolder.determine_args() (with a bound kwargs argument), so it can consult mode and kwargs to determine the args to use.
* | Add new compiler.get_argument_syntax methodDylan Baker2018-11-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | Some compilers try very had to pretend they're another compiler (ICC pretends to be GCC and Linux and MacOS, and MSVC on windows), Clang behaves much like GCC, but now also has clang-cl, which behaves like MSVC. This method provides an easy way to determine whether testing for MSVC like arguments `/w1234` or gcc like arguments `-Wfoo` are likely to succeed, without having to check for dozens of compilers and the host operating system, (as you would otherwise have to do with ICC).
* | interpreter: Don't warn about clang b_undef and b_sanitizer if sanitizer is noneDylan Baker2018-11-021-1/+2
| | | | | | | | Since the "none" sanitizer isn't actually a sanitizer at all.
* | Make string division do path joining.Jussi Pakkanen2018-11-021-1/+1
| |
* | Print dependencies being used for compiler checksNirbheek Chauhan2018-10-291-30/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is a common idiom to look for a function or a specific type or a header in various locations/libraries, and it can be confusing to see the (seemingly) identical compiler check being done multiple times. Now we print the dependencies being used when a compiler check is run Before: Checking for function "fbGetDisplay": NO Checking for type "GLeglImageOES": YES Checking for function "asinh": YES After: Checking for function "fbGetDisplay" with dependency egl: NO Checking for type "GLeglImageOES" with dependencies glesv2, gl: YES Checking for function "asinh" with dependency -lm: YES
* | Rollback if an optional subproject failsXavier Claessens2018-10-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | If a subproject is not required and fails during its configuration, the parent project continues, but should not include any target or state set by the failed subproject. This fix ninja still trying to build targets generated by subprojects before they fail in their configuration. The 'build' object is now per-interpreter instead of being global. Once a subproject interpreter succeed, values from its 'build' object are merged back into its parent 'build' object.
* | Add 'disabler' argument to functions returning not-found objectsXavier Claessens2018-10-231-1/+7
| | | | | | | | | | | | When dependency(), find_library(), find_program(), or python.find_installation() return a not-found object and disabler is true, they return a Disabler object instead.
* | wrap: Improve error handling and loggingXavier Claessens2018-10-181-26/+23
| |
* | os.path.relpath() can fail on WindowsJon Turney2018-10-101-11/+4
| | | | | | | | | | | | | | | | | | If builddir and sourcedir have different drive letters, a relative path doesn't exist, and os.path.relpath fails with a ValueError exception. This just fixes the places which are hit by test cases in a simple-minded way. There are several other uses of os.path.relpath(), which might be suspect.
* | configure_file: Support taking values from a dictXavier Claessens2018-10-081-4/+18
| | | | | | | | Closes #4218
* | Expose wrap_mode as an option. Closes #4266.Jussi Pakkanen2018-10-071-4/+4
| |
* | Merge pull request #3900 from xclaesse/in-operatorJussi Pakkanen2018-10-071-8/+1
|\ \ | | | | | | Interpreter: Add "in", "not in", "break", and "continue" operators
| * | Interpreter: Add "in" and "not in" operatorsXavier Claessens2018-10-041-8/+1
| | | | | | | | | | | | Closes: #3600
* | | dependency variable from subproject could be not-foundXavier Claessens2018-10-071-16/+14
| | | | | | | | | | | | | | | When using a subproject as fallback for a required dependency, we should check if the dependency object we get from the subproject is found.
* | | Substitute output file then check for conflict.Christoph Behle2018-10-071-5/+5
|/ / | | | | | | | | | | | | | | | | Fixes Issue #4323. The check to see if a call to configure_file() overwrites the output of a preceding call should perform the substitution for the output file before doing the check. Added tests to ensure the proper behaviour.
* | Centralize description of build, host, and target, machinesJohn Ericson2018-10-051-65/+22
| | | | | | | | | | | | Instead of just putting these together in the interpreter, put them together in `environment.py` so Meson's implementation can also better take advantage of them.
* | Make custom dist scripts accept arguments.Jan Tojnar2018-10-041-3/+6
| | | | | | | | | | | | meson.add_dist_script, introduced in #3906, did not accept any arguments other than script name. Since all other meson.add_*_script methods do accept args, this makes the dist script accept them as well.
* | Fix version check when passing feature option to find_installation()Xavier Claessens2018-09-171-2/+4
|/
* Add method to check for C/C++ function attributesDylan Baker2018-09-071-0/+20
| | | | | | | | | | | | | | | It's fairly common on Linux and *BSD platforms to check for these attributes existence, so it makes sense to me to have this checking build into meson itself. Autotools also has a builtin for handling these, and by building them in we can short circuit cases that we know that these don't exist (MSVC). Additionally this adds support for two common MSVC __declspec attributes, dllimport and dllexport. This implements the declspec version (even though GCC has an __attribute__ version that both it and clang support), since GCC and Clang support the MSVC version as well. Thus it seems reasonable to assume that most projects will use the __declspec version over teh __attribute__ version.
* Test + fix for not-found dependency fallback version comparisonNirbheek Chauhan2018-09-041-1/+8
| | | | | | | | Fixes: meson.build:6:0: ERROR: Uncomparable version string 'unknown'. This was previously partially fixed in a8694f4b, which only fixed it for cached fallback dependencies.
* Allow override_find_program to use an executable.Rafael Ávila de Espíndola2018-09-031-5/+9
| | | | | | | | | | | | | | | With this it is now possible to do foobar = executable('foobar', ...) meson.override_find_program('foobar', foobar) Which is convenient for a project like protobuf which produces both a dependency and a tool. If protobuf is updated to use override_find_program, it can be used as protobuf_dep = dependency('protobuf', version : '>=3.3.1', fallback : ['protobuf', 'protobuf_dep']) protoc_prog = find_program('protoc')
* Meson should warn if b_lundef is mixed with any sanitizer with clangAlexis Jeandet2018-09-021-4/+3
| | | | Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
* Merge pull request #4016 from thiblahute/hotdocJussi Pakkanen2018-08-291-1/+6
|\ | | | | modules: Add an 'hotdoc' module
| * interpreter: Also process *TargetHolder returned by modulesThibault Saunier2018-08-181-0/+3
| | | | | | | | | | | | The module might need to add extra methods on the returned targets and thus it can return TargetHolders, we should process the held targets
| * interpreter: Handle 'bool, str, int' values returned by modulesThibault Saunier2018-08-181-1/+3
| |
* | Add support for custom dist scripts.Jussi Pakkanen2018-08-271-0/+10
| |
* | Merge pull request #3981 from GoaLitiuM/d-win-fixesJussi Pakkanen2018-08-271-1/+1
|\ \ | | | | | | Fix D support on Windows
| * | Normalize string constructs of d_import_dirs pathsGoaLitiuM2018-08-201-1/+1
| |/ | | | | | | Fixes skipped deprecation warnings of badly constructed d_import_dirs on Windows.
* | Add a `required` argument to `subproject`Thibault Saunier2018-08-271-15/+70
| | | | | | | | | | | | | | | | | | | | Allowing to use the new "feature" option type and allowing not to fail on subproject if it is not necessary to fail. By default subprojects are "required" so previous behaviour is not changed. Fixes #3880
* | Don't use version to check for a not-found fallbackJon Turney2018-08-261-1/+1
| | | | | | | | | | In _find_cached_fallback_dep(), actually check if dependency is not found, rather than using a specific version as a proxy for that.
* | Merge pull request #3769 from xclaesse/command-line-step2Xavier Claessens2018-08-231-18/+12
|\ \ | | | | | | Command line step2
| * | interpreter: Simplify get_option_internal() and fix base option fallbackXavier Claessens2018-08-221-18/+12
| |/ | | | | | | | | | | | | The fallback to compilers.base_options was done after optname is changed to have subproject prefix. Simplify the code by looping over all dictionaries and only keep user_options separate because that one is special.
* | Added "native" kwarg to add_XXX_args. Closes #3669.Jussi Pakkanen2018-08-221-8/+28
|/
* Fix yielding when subproject option type is differentNirbheek Chauhan2018-08-141-4/+15
| | | | | | | | | | Earlier, we would replace the subproject option with the parent project's option, which is incorrect if the types are not the same. Now we retain the subproject's option and print a warning. It's not advisable to issue an error in this case because subproject option yielding is involuntary for the parent project (option names can match because of coincidences).
* Merge pull request #3831 from mesonbuild/symvisibilityJussi Pakkanen2018-08-111-0/+1
|\ | | | | Add gnu_symbol_visibility keyword argument
| * Call it gnu_symbol_visibility instead.Jussi Pakkanen2018-08-091-1/+1
| |
| * Add kwarg for specifying symbol visibility.Jussi Pakkanen2018-08-091-0/+1
| |
* | Fix FeatureNew false positive in vcs_tagNirbheek Chauhan2018-08-111-1/+5
|/ | | | Fixes https://github.com/mesonbuild/meson/issues/3904
* Don't check version for fallback not-found dependencyNirbheek Chauhan2018-08-081-0/+6
| | | | | | | | | Otherwise we get an error while checking the subproject version: Uncomparable version string 'none'. If the dependency was found as a not-found dependency in the subproject and is not required, just take it.
* Test that vim syntax highlighting is up-to-dateNirbheek Chauhan2018-08-071-4/+6
| | | | | | | Needs a `mock` kwarg to Interpreter to not do any parsing of build files, but only setup the builtins and functions. Also consolidate the documentation and data tests into one class.
* Fix missing permitted kwargPatrick Griffis2018-08-071-1/+1
| | | | get_pkgconfig_variable() takes a 'default' keyword