PDA

View Full Version : Project file and platform-specific rules



plaristote
17th February 2012, 21:27
Greetings my good sirs !

I'm here to ask a question that has been ask pleny and pleny of times : how to ensure that some rule in the project file will only be used on a given platform.
Back in the days, only one year ago, this used to do the trick :

WIN32:LIBS += -lsfml-window -lsfml-graphics -lsfml-system
UNIX:LIBS += -lyaml -lsfml-window -lsfml-graphics -lsfml-system

But now, though these aren't considered as syntax error, these lines are completely ignored by qmake. Just as if WIN32 or UNIX were undefined on both platforms. And this is true running both Windows and ArchLinux. I figured they might've been a change but I can't find anything talking about such a thing.

Maybe someone knows about this ?

Alir3z4
18th February 2012, 11:06
qmake-manual.html
qmake-project-files.html

wysota
18th February 2012, 21:58
Did you check if that was case sensitive?

win32:LIBS+= ...
unix:LIBS+= ...

We use plenty of such rules and they work just fine.