Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
275 views
in Technique[技术] by (71.8m points)

c++ - Qmake: how to remove compiler flag for a certain project, without changing qmake.conf?

I'm using qmake and Visual Studio. In release build qmake adds /GL and /O2 flags to all projects, and I need to remove those two flags for certain libraries within my whole Qt project. Is there a way?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had a similar problem and I solved it by adding the following directive in the .pro file:

QMAKE_CXXFLAGS_RELEASE -= -g

Observe the _RELEASE suffix, otherwise don't work.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...