Of course D compilers have different flags to set some important
D-specific settings. This adds a simple method to change these flags in
a compiler-agnostic way in Meson.
This replaces the previous `unittest_args` method with a more generic
variant.
An example trace:
[snip]
> File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
> result = self.fn(*self.args, **self.kwargs)
> File "/home/trhd/Projects/meson/mesonbuild/mtest.py", line 221, in run_single_test
> child_env.update(self.options.global_env.get_env(child_env))
> AttributeError: 'dict' object has no attribute 'get_env'
PR #1955 added implib to known_exe_kwargs, but since PR #2001 it needs to be
in exe_kwargs as well, to avoid 'WARNING: Passed invalid keyword argument
"implib"' when it is used.
Commit 325a231a added stricter keyword argument checking, but didn't enable
keyword arguments for add_projects_link_arguments() and
add_global_link_arguments(). This makes them fail with this error:
Meson encountered an error in file meson.build, line 19, column 0:
Function does not take keyword arguments.
However, the language argument is required. Removing it produces this error
instead:
Meson encountered an error in file meson.build, line 19, column 0:
Missing language definition in add_project_link_arguments
Fix this by adding 'language' as a required keyword argument. Also add calls to
these in the "146 C and CPP link" test case.
This class now consolidates a lot of the logic that each external
dependency was duplicating in its class definition.
All external dependencies now set:
* self.version
* self.compile_args and self.link_args
* self.is_found (if found)
* self.sources
* etc
And the abstract ExternalDependency class defines the methods that
will fetch those properties. Some classes still override that for
various reasons, but those should also be migrated to properties as
far as possible.
Next step is to consolidate and standardize the way in which we call
'configuration binaries' such as sdl2-config, llvm-config, pkg-config,
etc. Currently each class has to duplicate code involved with that
even though the format is very similar.
Currently only pkg-config supports multiple version requirements, and
some classes don't even properly check the version requirement. That
will also become easier now.