aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
AgeCommit message (Collapse)AuthorFilesLines
2018-11-04Only add link arguments when needed in Compiler object methodsJon Turney1-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.
2018-11-03Add new compiler.get_argument_syntax methodDylan Baker1-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).
2018-11-02interpreter: Don't warn about clang b_undef and b_sanitizer if sanitizer is noneDylan Baker1-1/+2
Since the "none" sanitizer isn't actually a sanitizer at all.
2018-11-02Make string division do path joining.Jussi Pakkanen1-1/+1
2018-10-29Print dependencies being used for compiler checksNirbheek Chauhan1-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
2018-10-29Rollback if an optional subproject failsXavier Claessens1-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.
2018-10-23Add 'disabler' argument to functions returning not-found objectsXavier Claessens1-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.
2018-10-18wrap: Improve error handling and loggingXavier Claessens1-26/+23
2018-10-10os.path.relpath() can fail on WindowsJon Turney1-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.
2018-10-08configure_file: Support taking values from a dictXavier Claessens1-4/+18
Closes #4218
2018-10-07Expose wrap_mode as an option. Closes #4266.Jussi Pakkanen1-4/+4
2018-10-07Merge pull request #3900 from xclaesse/in-operatorJussi Pakkanen1-8/+1
Interpreter: Add "in", "not in", "break", and "continue" operators
2018-10-07dependency variable from subproject could be not-foundXavier Claessens1-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.
2018-10-07Substitute output file then check for conflict.Christoph Behle1-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.
2018-10-04Interpreter: Add "in" and "not in" operatorsXavier Claessens1-8/+1
Closes: #3600
2018-10-05Centralize description of build, host, and target, machinesJohn Ericson1-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.
2018-10-04Make custom dist scripts accept arguments.Jan Tojnar1-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.
2018-09-17Fix version check when passing feature option to find_installation()Xavier Claessens1-2/+4
2018-09-07Add method to check for C/C++ function attributesDylan Baker1-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.
2018-09-04Test + fix for not-found dependency fallback version comparisonNirbheek Chauhan1-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.
2018-09-03Allow override_find_program to use an executable.Rafael Ávila de Espíndola1-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')
2018-09-02Meson should warn if b_lundef is mixed with any sanitizer with clangAlexis Jeandet1-4/+3
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2018-08-29Merge pull request #4016 from thiblahute/hotdocJussi Pakkanen1-1/+6
modules: Add an 'hotdoc' module
2018-08-27Add support for custom dist scripts.Jussi Pakkanen1-0/+10
2018-08-27Merge pull request #3981 from GoaLitiuM/d-win-fixesJussi Pakkanen1-1/+1
Fix D support on Windows
2018-08-27Add a `required` argument to `subproject`Thibault Saunier1-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
2018-08-26Don't use version to check for a not-found fallbackJon Turney1-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.
2018-08-23Merge pull request #3769 from xclaesse/command-line-step2Xavier Claessens1-18/+12
Command line step2
2018-08-22Added "native" kwarg to add_XXX_args. Closes #3669.Jussi Pakkanen1-8/+28
2018-08-22interpreter: Simplify get_option_internal() and fix base option fallbackXavier Claessens1-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.
2018-08-20Normalize string constructs of d_import_dirs pathsGoaLitiuM1-1/+1
Fixes skipped deprecation warnings of badly constructed d_import_dirs on Windows.
2018-08-18interpreter: Also process *TargetHolder returned by modulesThibault Saunier1-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
2018-08-18interpreter: Handle 'bool, str, int' values returned by modulesThibault Saunier1-1/+3
2018-08-14Fix yielding when subproject option type is differentNirbheek Chauhan1-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).
2018-08-11Merge pull request #3831 from mesonbuild/symvisibilityJussi Pakkanen1-0/+1
Add gnu_symbol_visibility keyword argument
2018-08-11Fix FeatureNew false positive in vcs_tagNirbheek Chauhan1-1/+5
Fixes https://github.com/mesonbuild/meson/issues/3904
2018-08-09Call it gnu_symbol_visibility instead.Jussi Pakkanen1-1/+1
2018-08-09Add kwarg for specifying symbol visibility.Jussi Pakkanen1-0/+1
2018-08-08Don't check version for fallback not-found dependencyNirbheek Chauhan1-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.
2018-08-07Test that vim syntax highlighting is up-to-dateNirbheek Chauhan1-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.
2018-08-07Fix missing permitted kwargPatrick Griffis1-1/+1
get_pkgconfig_variable() takes a 'default' keyword
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