If you're using Lazarus svn, then you can set up different build modes (debug, release, optimized, etc). I set up two modes, debug and release.
Debug consists of: enable all checkings, no optimization at all, full debugging info, disable stripping and smartlinking.
Release consists of: disable all checkings, level 3 optimization + regvar, no debugging info, strip symbols and create smartlinkable units + enable smartlinking.