Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What qmake variable is used for Objective-C compilation flags?

Tags:

qt

qmake

QMAKE_CXXFLAGS are applied when compiling .cpp files, but not applied to .mm files. Which flag should I use instead?

like image 821
developer Avatar asked Sep 13 '25 23:09

developer


1 Answers

Those flags belong in QMAKE_OBJECTIVE_CFLAGS (not QMAKE_OBJECTIVE_CXXFLAGS).

The flags used in precompiled header generation go into QMAKE_OBJCXXFLAGS_PRECOMPILE,

Objective-C compilation is handled by qtbase/mkspecs/features/mac/objective_c.prf. An objective_c compiler is defined on-the-fly when Objective C/C++ sources are present. You can glean other details there.

The precompilation flags are handled by the Unix makefile generator: qtbase/qmake/generators/unix/unixmake.cpp and unixmake2.cpp.

I offer no comment as to the consistency of those variable names and their locus of implementation. Don't shoot the messenger.

like image 79
Kuba hasn't forgotten Monica Avatar answered Sep 18 '25 23:09

Kuba hasn't forgotten Monica