Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Cool Javelin on January 27, 2019, 11:38:50 pm

Title: How to prevent automatic build (SOLVED)
Post by: Cool Javelin on January 27, 2019, 11:38:50 pm
There is a gear icon that can build my project, also a red play button that launches the debugger.

How can I prevent the debugger launcher from automatically rebuilding my project before launching?

I have been all over looking for this setting and I have search the web and this forum pretty extensively for an answer.

The reason for this question: I recently added some pre-build scripts, one of which increments a version number that is included as a header file.

Since then, C::B rebuilds the project each time I hit the red play button (launch the debugger.)

Sometimes I do not want to rebuild the project when I simply exit the debugger and restart it. (C::B doesn't know I have done no editing.)

Thanks for the help, Mark.
Title: Re: How to prevent automatic build
Post by: BlueHazzard on January 28, 2019, 12:30:31 am
Codeblocks will not rebuild if the source did not changed. It will only rebuild when the source changed and this is necessary before debugging, because the source and the debugee have to be in sync. Debugging would not work if the source and debugee differ (if you delete a function in your code, but debug this function, where should codeblocks jump if the debugger request this function?

To solve your problem:
Create a new target only for debugging, where you do not add the prebuild steps

or

Remove the tick at Project->Build options->Pre post build steps->Always execute, even if target is up to date . Then your version will only be incremented if you change your code...
Title: Re: How to prevent automatic build
Post by: oBFusCATed on January 28, 2019, 01:46:14 am
How can I prevent the debugger launcher from automatically rebuilding my project before launching?
There is an option in the Settings -> Debugger -> Auto-build project if it is not up to date.
Title: Re: How to prevent automatic build
Post by: Cool Javelin on January 30, 2019, 02:28:45 am
Thank you oBFusCATed

That is the magic setting I wanted.

Mark.