Results 1 to 4 of 4

Thread: How can we add -O2 flag into .pro file?

  1. #1
    Join Date
    Sep 2008
    Posts
    93
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default How can we add -O2 flag into .pro file?

    Hello,

    I hope add -O2 optimization flag to the .pro file and I did like this:
    QMAKE_CXXFLAGS += -o2

    But it seems that the Makefile still use -o instead of o2.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How can we add -O2 flag into .pro file?

    Don't you mean -O and -O2? -O2 will automatically be added if you compile in release mode. "-o" is for specifying the output file.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2008
    Posts
    93
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default Re: How can we add -O2 flag into .pro file?

    Thanks!

    Yes, I mean -O2. In debug mode, how can we add this optimization flag from .pro file?

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How can we add -O2 flag into .pro file?

    I'm a bit confused as to why you would want to. Normally you want to debug your code whilst in debug mode, so you want the least amount of optimisation possible. Only when your code works would you want to increase optimisation to increase speed.

    Adding -O2 to debug build will cause all sorts of problem for debugging. Are you sure sure this is what you want?

Similar Threads

  1. library in .pro file for qt
    By fbmfbm in forum Qt Programming
    Replies: 18
    Last Post: 9th July 2010, 08:37
  2. Replies: 2
    Last Post: 28th June 2009, 12:39
  3. Replies: 2
    Last Post: 8th November 2007, 20:15
  4. need script to change qmake .pro file
    By rajeshs in forum Qt Programming
    Replies: 5
    Last Post: 7th July 2007, 17:53
  5. Can I use the Sql Module without chanage .pro file?
    By fengtian.we in forum Qt Programming
    Replies: 9
    Last Post: 21st May 2007, 10:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.