We were more hesitant to do this earlier because it might have messed
up custom_target command lines, but since we always use a wrapper for
that now, it should be ok to do this.
Add a test in the form of a funky generator script.
They are the 'weird' platforms, so we want them to be run first.
That way we don't have to wait for all the other tests before finding
out that something broke.
Also sets more groundwork for running unit tests with backends other
that Ninja.
Transferring global state to executors is totally broken in Python 3.4
so just serialize all the commands.
And use generic build/clean/test/install commands in the unit tests,
just like project tests. This sets the groundwork for running the unit
tests with all backends.
configure a detection method, for those types of dependencies that have
more than one means of detection.
The default detection methods are unchanged if 'method' is not
specified, and all dependencies support the method 'auto', which is the
same as not specifying a method.
The dependencies which do support multiple detection methods
additionally support other values, depending on the dependency.
When cross compiling with mingw it's problematic to assume that there is
a binary called windres, and having to set it via an environment
variable seems wrong when there is a handy cross-file for just such a
situation.
This patch allows setting windres in the [binaries] section of the cross
file. If the build is a cross build, then the windows module will check
for windres being set in the cross file before checking the WINDRES
environment variable or looking for a windres binary.
I don't really know how to explain this briefly...
If you don't decorate this with dllimport, then a Cygwin runtime relocation
is used (a so called 'pseudo-reloc'). As the relocation offset is only 32
bits, this can fail on x86_64 if the DLL happens to be loaded more than 2GB
away from the reference.
If you decorate with dllimport, then access is indirected via a pointer,
imp_square_unsigned, which is fixed up by the loader.
'test cases/common/12 data' and 'test cases/common/66 install subdir' both
try to install something as 'root'. This user doesn't exist on Cygwin.
Perhaps we should automatically convert this to some other user, but it's
not clear which. For real projects, it's possibly better for the meson.build
to explicitly handle this...
'test cases/common/12 data' also tries to install something with GID 0.
There's no guarantee this group exists.
Including newlib's <stdlib.h> brings in a '#define __has_include 0', so
using -U__has_include on the command line isn't going to remove it (so the
fallback doesn't happen and the test fails)
Instead use a '#undef __has_include' at the end of the prefix to excerise
this.
(newlib's <stdlib.h> is derived from FreeBSD, so the same problem will
probably be seen there)