Ada Programming/Platform/Portable builds

GPRbuild can be used to make portable builds.

Platform-independent code
Create a project for platform-independent code which is common to all supported platforms.

portable.gpr

Portable Main ("portable.adb"); Exec_Dir "bin"; Source_Dirs use ("src"); Portable;

Platform-specific code
For example, open portable-windows.gpr with GPS or GPRbuild to build a project for Windows.

portable-windows.gpr

Portable.Windows "portable.gpr" Languages ("Ada", "WinRes"); Source_Dirs ("windows", "resources"); Object_Dir "windows-obj"; Exec_Dir "bin"; Linker for Default_Switches ("Ada") use ("-lgdi32", "windows-obj/resources.o", "-mwindows"); Linker; Compiler Driver ("WinRes") "windres"; Default_Switches ("WinRes") ("--target=pe-x86-64"); Leading_Required_Switches ("WinRes") ("-i"); Object_File_Suffix ("WinRes") ".o"; Compiler; Naming Body_Suffix ("WinRes") ".rc"; Naming; Portable.Windows;