Chapter 32 Key Takeaways
-
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.
-
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.
-
Windows deployment: Portable ZIP (simplest) or Inno Setup installer (professional, with shortcuts and uninstall). Include sqlite3.dll.
-
Linux deployment: Raw binary (simplest), .deb package (Debian/Ubuntu), or AppImage (distribution-agnostic, single file).
-
macOS deployment: .app bundle (required), optionally in a DMG. Code signing with an Apple Developer ID prevents Gatekeeper warnings.
-
Cross-compilation is supported but building on the target platform (or in a VM) is more reliable for GUI applications.
-
Use platform-agnostic functions:
GetAppConfigDirfor config paths,Application.Locationfor the executable directory,PathDelimorConcatPathsfor path construction,LineEndingfor text line breaks. -
Test on clean systems without development tools to catch missing dependencies before users encounter them.
-
Cross-platform gotchas: file path separators, font availability, DPI scaling, dark themes, case-sensitive file systems, dialog button order, and locale-dependent number formatting.
-
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.