This is really useful when debugging test failures. Without a stack
trace, you have to grep the source code for the error message.
Also set this in run_tests.py.
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.
This commit syncs the list with gnome-builder, which updates its list
in https://bugzilla.gnome.org/show_bug.cgi?id=782296.
llvm-config40 is added becaue LLVM 4.0 becomes a stable release.
llvm-config-5.0 is added to the bottom of the list because it is still
a development snapshot (svn trunk).
While g-ir-scanner's compatible -I and -D flags cover what most pkg-config
files use, there's no guarantee that files don't set anything more exotic
that conflicts with the tool's own options.
For a real world example, mozjs-38 has '-include some-header-file.h', which
translates to '--include nclude another-file-to-scan.h' for the scanner;
unless for some reason there's an 'nclude' GIR available on the system,
the target will thus fail.
Avoid this case by pointing g-ir-scanner to the correct pkg-config file
instead of passing any cflags directly.
When the CCompiler.links method call in CCompiler.find_library fails,
find_library resorts to finding the library file itself. In this second
case, the return value is not a list, whereas if links suceeds, the
return value is a list. Make it so that find_library returns a list
in either case.
This is more reliable, and more accurate. For instance, this means
arguments in commands aren't surrounded by `'` on Linux unless that
is actually needed by that specific argument.
There is no equivalent helper for Windows, so we keep the old
behaviour for that.
Now we aggressively de-dup the list of libraries used while linking,
and when linking with GNU ld we have to enclose all static libraries
with -Wl,--start-group and -Wl,--end-group to force the linker to
resolve all symbols recursively. This is needed when static libraries
have circular deps on each other (see included test).
The --start/end-group change is also needed for circular dependencies
between static libraries because we no longer recursively list out all
library dependencies.
The size of build.ninja for GStreamer is now down to 6.1M from 20M,
and yields a net reduction in configuration time of 10%
We were doing this on the basis of an old comment, but there was no
test for it and I couldn't reproduce the issue with clang on Linux
at all.
Let's add a (somewhat comprehensive) test and see if it breaks
anywhere if we stop doing this.
Halves the size of gstreamer's build.ninja from 20M to 8.7M
Closes https://github.com/mesonbuild/meson/issues/1057