[Qbs] cpp.cppFlags and ccache

Christian Gagneraud chgans at gmail.com
Thu May 24 01:25:56 CEST 2018


Hi,

I was building my qbs project with QtCreator, my products use
'cpp.cppFlags: [ "-Wno-unknown-pragmas" ]', when i use a kit that use
/usr/bin/g++, everything work as expected (no gcc warning about
'#pragma warning', when i switch to /usr/lib/ccache/g++ (a symlink to
/.usr/bin/ccache), i get tons of gcc about '#pragma warning'.
The command line generated by qbs is:
/usr/lib/ccache/g++ ... -Wp,-Wno-unknown-pragmas ...

I don't know why this is prefixed with -Wp, but it seems to annoy ccache.

>From gcc doc:
You can use -Wp,option to bypass the compiler driver and pass option
directly through to the preprocessor. If option contains commas, it is
split into multiple options at the commas. However, many options are
modified, translated or interpreted by the compiler driver before
being passed to the preprocessor, and -Wp forcibly bypasses this
phase. The preprocessor's direct interface is undocumented and subject
to change, so whenever possible you should avoid using -Wp and let the
driver handle the options instead.

Could it be a bug with ccache, or is Qbs doing something wrong/weird?
Looking at changelog of ccache, it seems that quite a few things have
been fixed regarding -Wp, but most of them deal with -Wp,-M/P/D.

ccache 3.2.4, gcc 5.4.0, i386/ubuntu-16.04


Chris



More information about the Qbs mailing list