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. How to set compiler directives per build configuration
Forum Updated to NodeBB v4.3 + New Features

How to set compiler directives per build configuration

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.4k 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.
  • G Offline
    G Offline
    GoDonkeys
    wrote on 6 Feb 2014, 21:50 last edited by
    #1

    I have the following in my .pro file to send the -DDEBUG directive when I am using the debug configuration:
    @CONFIG (debug)
    {
    DEFINES += DEBUG
    }@

    When I compile I get the following output, which I would expect

    g++ -c -pipe -g -fPIC -Wall -W -D_REENTRANT -DDEBUG ...

    The problem is that when I want to build a release version of my program, the -DDEBUG is still showing up when I compile even though it appears that the rest of the output is as I would expect

    g++ -c -pipe -O2 -fPIC -Wall -W -D_REENTRANT -DDEBUG -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED...

    I'm using the DEBUG directive provide debugging output to the screen as well as intermediate files which will not be available for my release version.

    Any help would be greatly appreciated.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      steno
      wrote on 6 Feb 2014, 22:34 last edited by
      #2

      I don something like this,

      @

      CONFIG(debug, debug|release) {
      CONFIG_SUFFIX = Debug
      DEFINES += _DEBUG
      } else {
      CONFIG_SUFFIX = Release
      }

      @

      1 Reply Last reply
      0
      • G Offline
        G Offline
        GoDonkeys
        wrote on 6 Feb 2014, 22:43 last edited by
        #3

        That did it.

        Thanks!

        1 Reply Last reply
        0

        1/3

        6 Feb 2014, 21:50

        • Login

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