Reputation:
I would like to have my CodeGear Delphi 2007 project to automatically set the debug module attributes depending on whether my project is in debug or release mode.
I can manually set this value by right clicking on the project->Version Info->Edit values as needed. These are for the project as a whole and are the same for the debug and release builds.
Is there a way to automatically set the manifest to Debug if the #debug compiler directive is present?
Is there another way to easily detect is an exe was build as a debug or release version?
Upvotes: 6
Views: 3430
Reputation: 43602
Another solution would be to use a resource editor post build to change it. Like http://www.heaventools.com/rtconsole-update-version-info.htm
Upvotes: 1
Reputation: 43602
You could if you do it the other way around if you use the commandline compiler. Tell the compiler to compile for debug or release. Set a compiler directive to DEBUG for the debug build (it does that by default).
msbuild YourProject.dproj /p:Configuration=Release
msbuild YourProject.dproj /p:Configuration=Debug
Upvotes: 2
Reputation: 20132
There is a Delphi wiki writeup about exactly this question:
Easily Switching between "Debug" and "Release" Builds
Upvotes: 1