[PATCH] Use compilation flags.
Lubomir I. Ivanov
neolit123 at gmail.com
Thu Aug 21 07:14:41 PDT 2014
On 21 August 2014 13:50, Dirk Hohndel <dirk at hohndel.org> wrote:
> On Thu, Aug 21, 2014 at 10:16:17AM +0200, Salvo 'LtWorf' Tomaselli wrote:
>> This makes qmake aware of CFLAGS, CXXFLAGS, LDFLAGS, CPPFLAGS.
> Thanks for sending your first two patches and welcome to the team!
>> This is helpful to easily add flags to the compilation (such as
>> hardening flags).
> Question to our Qt people... is that what people usually do?
> I'll admit that I tried to use CFLAGS when wanting to set some debugging
> macros in the past (simply habit), but I wonder if there's some reason why
> this isn't there by default?
i don't think that is needed because qmake is what generates the
Makefile and CFLAGS, CXXFLAGS etc are Makefile variables.
what it does is add the values of the contents of the env. variables
CFLAGS...to qmake's QMAKE_CFLAGS variable and it *does* require that
you re-run qmake if the source env. variable changes.
if you want to pass extra arguments to qmake (i.e. make it aware of
extra arguments) you could simply do:
qmake "QMAKE_CFLAGS += <something>"
but you are again re-running qmake.
now, adding arguments via the 'make' cmd line invocation is another thing...
make CFLAGS+= <something>
to my knowledge, would need the "override CFLAGS" directive in the
Makefile itself, but qmake does not produce it by default or possibly
it does not even support it.
More information about the subsurface