The IDE (and LCL), can be build via the tool menu or makefiles.
For the menu, you found the right place. For makefiles (not relevant, unless you open cmd.exe, and run make.exe) you give them to make.exe on command line.
However, the options you set in the menu. Most packages will respect them too. Some packages miss that setting. Each package has it's own "compiler option dialog" (reachable from the package mgr window).
Look under "Other", if "$(IDEBuildOptions)" (without quotes) is specified.
As for multiply -O1 -O2.
I think the last is respected. But it could also be the higher one.
In any case this will do O1
-O2 -O- -O1
-O- cancels out the previous
About dwarf, you have 3 choices:
1) Compile the LCL (and IDE) without any debug info -g-
- That is the least desirable. Even if you intend to never step into any LCL procedure while debugging.
- It will also loose the ability to inspect certain global variables in the LCL. e.g Application or other such globals
- If ever you run into trouble with the IDE, there will be no stacktraces => very hard to get help
2) use stabs -gs (make sure it applies to all packages too, see above)
3) keep dwarf
At the moment dwarf has only a very few improvements over stabs (such as displaying selected properties (those that map to fields, instead of a getter), when inspecting objects)
But most future work, will go into dwarf.
oh, just to mention: stabs/dwarf are to ways of encoding debug info into the exe.
So, if you release your app, you will build with strip-symbols, and neither go into your app.
I haven't tested it, but your app should smart link, even if you did build packages with dwarf => just specify not to use it, when compiling and linking your app.
there are 2 switches.
- smart-linkable (prepare unit to be smart linked)
- smart link (actually do it)
Not sure, why smart-linkable is not set by default for the LCL (if that is the case, I never checked myself)