I mean, it only produces debug mode executables.
Are you using "Build & Run" or "Build & Debug" ?
Have you got the "Debug Build" option ticked under Project \ Build Options?
If you uncheck the menu option, then you should be able to build your code in debug or non-debug mode using the "Build & Run" or "Build & Debug" options.
Still not entirely happy how "Build" & "Build Options" work together...