Precompiled headers: supply "-x c-header" or "-x c++-header" if available.

Some older versions of gcc give "all.hpp: linker input file unused
because linking not done" otherwise, because they don't realize files
named *.hpp are headers.

Reported-by: Wayne Scott <wsc9tt@gmail.com>
This commit is contained in:
Avery Pennarun 2019-02-25 13:09:11 +00:00
commit 1574b11598
5 changed files with 27 additions and 9 deletions

View file

@ -31,6 +31,7 @@ cat >$3 <<-EOF
CXXFLAGS=
PCH1=$(shquote "$CFLAGS_PCH")
PCH2=$(shquote "$CFLAGS_PCH_FPIC")
PCH3=$(shquote "$CFLAGS_PCH_LANG")
;;
*)
CC=$(shquote "$CXX")
@ -39,11 +40,13 @@ cat >$3 <<-EOF
CXXFLAGS=$(shquote "$CXXFLAGS")
PCH1=$(shquote "$CXXFLAGS_PCH")
PCH2=$(shquote "$CXXFLAGS_PCH_FPIC")
PCH3=$(shquote "$CXXFLAGS_PCH_LANG")
;;
esac
case \$PCH in
1) FLAGS_PCH=\$PCH1 ;;
2) FLAGS_PCH=\$PCH2 ;;
3) FLAGS_PCH=\$PCH3 ;;
esac
. ./_compile
EOF