Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Disable assert
Forum Updated to NodeBB v4.3 + New Features

Disable assert

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.4k Views
  • 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 Offline
    D Offline
    debian
    wrote on last edited by
    #1

    Hello!
    I use Qt-5.12.2, I can use qmake parameters release/debug for disable/enable debug build. Now I should disable assert, for this I should define NDEBUG.
    I grep sources of Qt, but I don't found what qmake parametr release add NDEBUG macros, so my question - I should manually add NDEBUG or qmake make this at release build?
    Thank you.

    jsulmJ 1 Reply Last reply
    0
    • D debian

      Hello!
      I use Qt-5.12.2, I can use qmake parameters release/debug for disable/enable debug build. Now I should disable assert, for this I should define NDEBUG.
      I grep sources of Qt, but I don't found what qmake parametr release add NDEBUG macros, so my question - I should manually add NDEBUG or qmake make this at release build?
      Thank you.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @debian In pro file add

      DEFINES += NDEBUG
      
      1 Reply Last reply
      2
      • D Offline
        D Offline
        debian
        wrote on last edited by
        #3

        Hello, @jsulm , so qmake doesn't make this?
        Ok, thank you.

        jsulmJ 1 Reply Last reply
        0
        • D debian

          Hello, @jsulm , so qmake doesn't make this?
          Ok, thank you.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4
          This post is deleted!
          1 Reply Last reply
          0
          • Chris4567C Offline
            Chris4567C Offline
            Chris4567
            wrote on last edited by
            #5

            QMAKE_CXXFLAGS_RELEASE += -DNDEBUG

            will apply the NDEBUG define to release builds only.

            1 Reply Last reply
            1

            • Login

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