Chapter 32 Key Takeaways

  1. Release builds use optimization (-O2), symbol stripping, and minimal debug info. They are typically 3-6 MB compared to 15-25 MB for debug builds.

  2. Free Pascal statically links the runtime. Your executable is standalone — no runtime environment to install. Dynamic dependencies like SQLite3 must be shipped alongside the executable.

  3. Windows deployment: Portable ZIP (simplest) or Inno Setup installer (professional, with shortcuts and uninstall). Include sqlite3.dll.

  4. Linux deployment: Raw binary (simplest), .deb package (Debian/Ubuntu), or AppImage (distribution-agnostic, single file).

  5. macOS deployment: .app bundle (required), optionally in a DMG. Code signing with an Apple Developer ID prevents Gatekeeper warnings.

  6. Cross-compilation is supported but building on the target platform (or in a VM) is more reliable for GUI applications.

  7. Use platform-agnostic functions: GetAppConfigDir for config paths, Application.Location for the executable directory, PathDelim or ConcatPaths for path construction, LineEnding for text line breaks.

  8. Test on clean systems without development tools to catch missing dependencies before users encounter them.

  9. Cross-platform gotchas: file path separators, font availability, DPI scaling, dark themes, case-sensitive file systems, dialog button order, and locale-dependent number formatting.

  10. Native compilation is the deployment advantage. A 4 MB executable with no runtime dependencies, instant startup, and minimal resource usage is a compelling distribution story compared to any interpreted, JIT-compiled, or browser-based alternative.