Results 1 to 3 of 3

Thread: Easily switch between release and debug builds

  1. #1
    Join Date
    Mar 2008
    Location
    Colorado, USA
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Easily switch between release and debug builds

    I have a Qt project file with the line
    Qt Code:
    1. CONFIG += debug_and_release
    To copy to clipboard, switch view to plain text mode 
    and I am able to do a
    Qt Code:
    1. make debug
    To copy to clipboard, switch view to plain text mode 
    and
    Qt Code:
    1. make release
    To copy to clipboard, switch view to plain text mode 
    , and the executable will reflect whichever one I did last.

    The problem is, that once both executables are up to date, I want to easily switch between the two. If I've built in release mode, then debug mode, I can't build again in release mode unless I do a clean, since the executable file and object files are up to date. I get
    Qt Code:
    1. make[1]: Nothing to be done for `first'.
    To copy to clipboard, switch view to plain text mode 

    Is there a way to force the relink?

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Easily switch between release and debug builds

    If you have defined a target name with TARGET variable, then you can do this
    Qt Code:
    1. TARGET = my_app
    2. build_pass:CONFIG(debug, debug|release) {
    3. TARGET = $$join(TARGET,,,_debug)
    4. }
    To copy to clipboard, switch view to plain text mode 
    now "make release" will create "my_app" and "make debug" will give you executable file named "my_app_debug".

  3. #3
    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: Easily switch between release and debug builds

    Or do shadow builds.
    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.


Similar Threads

  1. switch to Debug build
    By saman_artorious in forum Qt Programming
    Replies: 7
    Last Post: 12th June 2013, 10:25
  2. Qt Creator only builds the Release version!
    By Verse in forum Qt Tools
    Replies: 6
    Last Post: 12th January 2010, 09:38
  3. Replies: 0
    Last Post: 15th November 2009, 10:40
  4. Why not on release but debug
    By baray98 in forum Qt Programming
    Replies: 6
    Last Post: 10th August 2007, 10:08
  5. Debug and Release
    By paranoid_android in forum Qt Programming
    Replies: 5
    Last Post: 18th November 2006, 14:58

Tags for this Thread

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.