Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [Solved] QMake and optimization flags for compiler
Forum Updated to NodeBB v4.3 + New Features

[Solved] QMake and optimization flags for compiler

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 23.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    herophuong
    wrote on last edited by
    #1

    I'm using Qt Creator and find out that in default, g++ will use -O2 for compiling phase and -O1 for linking phase. I have add -O3 to both QMAKE_CXXFLAGS and LIBS but end up with there both -O3 -O2 in compiling phase and -O1 -O3 in linking phase. Is there a way to control the optimization flags in .pro files?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      @
      QMAKE_CXXFLAGS_RELEASE -= -O2
      QMAKE_CXXFLAGS_RELEASE += -O3

      QMAKE_LFLAGS_RELEASE -= -O1
      @
      Make sure you've re-run qmake after modifying your .pro file.

      1 Reply Last reply
      2
      • H Offline
        H Offline
        herophuong
        wrote on last edited by
        #3

        Oh. I never thought of "-=" operator. Thank you very much.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved