This makes two basic changes, 1 it moves the name of the linker into the
linker class, this should reduce the number of errors and typos, and
ensure that a linker always has one name. This then renames the linkers
to have more consistent names.
Posix/gnu linkers are called ld.<name>: ld.gold, ld.lld, ld.solaris.
Apple linkers are renamed ld64.
This allows users to disable writing out the inbuilt variables to
the pkg-config file as they might actualy not be required.
One reason to have this is for architecture-independent pkg-config
files in projects which also have architecture-dependent outputs.
For example : https://gitlab.freedesktop.org/wayland/weston/issues/269Fixes#4011
This PR significantly improves the handling of the boost library
tags and also ensures that the found libraries are always compatible
(have the same ABI tag). The current setup can also be extended to
filter for additional features (static linking with the runtime, etc.).
Additionally, BOOST_ROOT is better supported (it is now guaranteed
that all found files belong to a single root directory).
Finally, boost.py is now fully annotated (and checked with mypy).
Do this by tracking CMAKE_CURRENT_{SOURCE,BINARY}_DIR variables.
This is achieved by injecting CMake code with CMAKE_PROJECT_INCLUDE
and overriding some builtin functions with a wrapper that adds
additional trace information.
This is a significant speed-up on Windows because terminals are
slow to print things out.
Speed-up in gst-build on Windows:
```
meson install:
before: 5.1 seconds
after: 4.0 seconds
```
In `--only-changed` mode, we were spending half our time inside
`makedirs()`, which is a waste in the case when only a few files have
changed.
Speed-up on Windows with gst-build:
```
meson install --only-changed
before: 1.6 seconds
after: 0.9 seconds
```
This gives a significant speedup in large projects such as gst-build
since now we only search for the tool once. Speed-up on Windows:
```
meson install:
before: 15.3 seconds
after: 5.4 seconds
meson install --only-changed:
before: 11.6 seconds
after: 2.7 seconds
```
If we preserve the existing file, we did not install anything. In that
case, the output now looks like:
```
ninja: Entering directory `.'
ninja: no work to do.
Nothing to install.
Preserved 1732 unchanged files, see meson-logs\install-log.txt for the full list
```
This also avoids an `isfile` lookup, which shaves off a few seconds in
gst-build install.
This leads to better version parsing. An concrete example use case is
llc. When invoking llc with "--version", the output is
```
LLVM (http://llvm.org/):
LLVM version 9.0.1
...
```
The old version parsing recognizes the dot in the first line as version.
This commit also tries to adapt the two regexes to each other.
Reported-by: Björn Fiedler <fiedler@sra.uni-hannover.de>
-g is --extern-only and -P is --format=posix. We were missing
--defined-only for some reason, which we pass to `nm` on Linux.
This avoids having to manually filter later.
Otherwise there's a high likelihood that some program run by us will
mess up the console settings and break ANSI colors. F.ex., running
`uname` in the Visual Studio 2019 x86 developer prompt using
`run_command()` does this.
This gives consistent reporting of this error for all platforms.
Also, reporting this error when constructing the BuildTarget, rather
than discovering the problem during backend generation means that the
error is reported against with a location.
This improves the common case of a simple meson.build which doesn't
contain any 'native: true' targets to not require a native compiler when
cross-compiling, without needing any changes in the meson.build.
v2:
Do it the right way around!