libgit2/libgit2 — pull request #1335 by phkelley (2013-02-13 17:46:13+00:00)
Title: Improve MSVC optimization settings for Release, RelWithDebInfo

**Please wait to merge until I have completed testing on MSVC 10.0 on Windows XP**

/GF - string pooling, enabled in all configurations to catch any problems from it (shouldn't be any: all my tests passed). Reduces the size of the produced binary.

#define _DEBUG - only for Debug configurations. This change also affects MinGW. Now that this is not present for RelWithDebInfo, Release configurations, you can run `filever git2.dll` and have it tell you the binary is `shp` instead of `dbg`.

/Oy- disables frame pointer omission (FPO) optimization. This optimization provides a marginal benefit to speed but makes retail builds very difficult to debug.

/GL (compiler) + /LTCG (linker) - whole program optimization. Allows inlining across object files to reduce code size and improve performance.

/Gy - function-level linking. Helps with folding in the link step.

/OPT:REF, /OPT:ICF - at the link step folds out unused code or duplicate code to reduce the size of the produced binary

/INCREMENTAL:NO - incremental linking is not supported when using many of these options.

/DYNAMICBASE, /LARGEADDRESSAWARE, /NXCOMPAT - no reason not to turn these flags on. Some or all of them have no meaning for DLLs, but for libgit2_clar.exe, they might. This change affects all configurations (Debug included).