Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    QMAKE_CXXFLAGS overriden ?

    Tools
    2
    3
    7745
    Loading More Posts
    • 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.
    • D
      dracheschreck last edited by

      Hi!

      I'm attempting to add this flag to the compiler so that my project, doesn't spew out hundreds of "ignoring #pragma warning" messages.

      @QMAKE_CXXFLAGS += -Wno-unknown-pragmas@

      Please, refrain from telling me to fix the warnings, since they are in the OpenNI libraries which I am using and do not intend to modify.

      I noticed that qmake correctly sets this flag in my makefile, like this:

      @CXXFLAGS = -m64 -pipe -Wno-unknown-pragmas -g -Wall -W -D_REENTRANT $(DEFINES)@

      The problem is that qmake is setting some other flags AFTER my flag, and probably one of them overrides mine. (probably -Wall?)

      I tested this by just putting my flag at the end of the line:

      @CXXFLAGS = -m64 -pipe -g -Wall -W -D_REENTRANT $(DEFINES) -Wno-unknown-pragmas@

      after running make, the warnings dissapeared as desired!

      Do you know why Qt Creator / qmake / ? is setting this -Wall flag? How can I avoid that this flag is set, or how can I make it so that my flag has higher priority? (i.e, be the last flag on the line)?

      Thanks for your help

      1 Reply Last reply Reply Quote 0
      • H
        Hostel last edited by

        Interesting situation. I checked this link:
        http://doc.qt.nokia.com/latest/qmake-variable-reference.html
        and googled a little. This will help you:
        @
        QMAKE_CXXFLAGS_WARN_ON += -Wno-unknown-pragmas
        @

        1 Reply Last reply Reply Quote 1
        • D
          dracheschreck last edited by

          Perfect! Thanks!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post