[SOLVED] Quick way to build in Debug or Release mode? IDE macro? lazarus / 11-Options ---------------------------------------------------------------------- grandehombre · 2014-01-26 04:17 Hi, I'd ideally like to have 2 different keys that do BuidlRelase and BuildDebug. At the moment, Shift-F9 builds in the current mode. Also, there is a button/dropdown on the left of the IDE toolbar (to the left of the green Run button). However, I'd like to be able to directly build in either mode without having to select it via that drop-down first. I'd probably leave Shift-F9 for BuildDebug and use Ctrl-Shift-F9 for BuildRelease. Any suggestions would be greatly appreciated! ---------------------------------------------------------------------- Leledumbo · 2014-01-26 06:47 Well, that would be not so simple since you can make A LOT of build modes. Perhaps a functionality to select build mode must be provided, only then a shortcut can be assigned to. ---------------------------------------------------------------------- grandehombre · 2014-01-27 01:35 Thanks for replying! I guess I'll have to wait and see when/what goodies are added in subsequent versions that may help with this. It is so close! The combobox with the current build modes is already there...just no way to pro grammatically alter it ---------------------------------------------------------------------- Leledumbo · 2014-01-27 08:46 QuoteIt is so close! The combobox with the current build modes is already there...just no way to pro grammatically alter itNot that close regarding keyboard shortcut. It's not a simple direct command, but it executes something that dynamically exists (one can have a lot, or even just one, how to tell the shortcut to pick up which one?). Anyway, the source is yours, feel free to provide a patch. Welcome to open source world. ---------------------------------------------------------------------- grandehombre · 2014-02-01 11:31 I did find a way to do it in the end! I created an external tool (via the Lazarus Tools/ConfigureExternalTools menu) that calls a batch file, passing the following parameters "$LazarusDir()"     "$ProjPath()"  "$ProjFile()" I've assigned it the key combination of Ctrl-Shift-F9 to it. The batch file contains the following: "%1lazbuild.exe" -B --build-mode=release %3 > build_release.log LazBuild is what does the trick. It can be found in the Lazarus directory. Since I use 2 versions of Lazarus, I need to know that path, thus param 1. Param2 is not really needed any more but could be handy if one needed to write a log file in the proj dir. I write the log file in the same dir that the batch file is in. I hope this is of use to others. For me, it means that all my builds from within the IDE are 'debug' builds, producing a very large EXE. When it is time to deploy, I press Ctrl-Shift-F9 and I get a small 'release' EXE without the debug info etc. ---------------------------------------------------------------------- JuhaManninen · 2014-02-01 15:57 There could be a GUI for building all or some of the modes. You could open the GUI window with a global shortcut and then continue with local shortcuts inside the window. Configure Build Lazarus window also has build profiles which are conceptually the same as build modes. You can already build many of those profiles. Patches are welcome. ---------------------------------------------------------------------- grandehombre · 2014-02-02 03:11 Hi JuhaManninen, Thanks for the info. At the moment, the method I described earlier does all I need, when it comes to building my projects in 'release' mode. Also, since it uses existing IDE features (External Tools), there is nothing for me to contribute back as a patch  Thanks again!