PDA

View Full Version : Define/Add flags to QMAKE_CFLAGS for different compilers



tesmai4
28th August 2013, 12:59
I have a a function definition that can be compiled with both MinGW or Visual C compiler. I need to define flags for the compiler.

See below, functionA has different definition for Visual C and MinGW compiler.

This is how I define flag in the .pro file


QMAKE_CFLAGS += -O2 -DVISUAL_STUDIO


This is in my code



#ifdef VISUAL_STUDIO
int functionA(
...........
#else
static inline int functionA(
..........


I get the following two warning:
:-1: warning: D9024 : unrecognized source file type 'VISUAL_STUDIO', object file assumed
:-1: warning: D9027 : source file 'VISUAL_STUDIO' ignored


Any idea how to do this?