meson: make cpp invocations cross-compilation friendly

This implementation assumes that the arguments in compiler.cmd_array()
don't contain any spaces. Since we are only interested in compilation
on Linux, I think this is a safe assumption.

Solution suggested by Nirbheek Chauhan.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2017-04-23 21:47:27 -04:00
parent 3131bfe302
commit 9cc0e6e99c
10 changed files with 18 additions and 12 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
#!/bin/sh -e
cpp -dM -include linux/capability.h -include "$1" -include "$2" - </dev/null | \
$1 -dM -include linux/capability.h -include "$2" -include "$3" - </dev/null | \
awk '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $2; }' | \
grep -v CAP_LAST_CAP