Ada 编程/平台/可移植构建
外观
GPRbuild 可用于构建可移植的构建。
为所有支持平台通用的平台无关代码创建项目。
portable.gpr
project
Portableis
for
Mainuse
("portable.adb"); -- GPS uses this to start the executablefor
Exec_Diruse
"bin";for
Source_Dirs use ("src");end
Portable;
例如,使用 GPS 或 GPRbuild 打开 portable-windows.gpr 以构建 Windows 项目。
portable-windows.gpr
project
Portable.Windowsextends
"portable.gpr"is
-- Object for Windows Resourcesfor
Languagesuse
("Ada", "WinRes");for
Source_Dirsuse
("windows", "resources");for
Object_Diruse
"windows-obj"; -- This should be the same as the parent project -- or the executable will be placed on the object directoryfor
Exec_Diruse
"bin";package
Linkeris
for Default_Switches ("Ada") use ("-lgdi32", "windows-obj/resources.o", "-mwindows");end
Linker;package
Compileris
for
Driver ("WinRes")use
"windres";for
Default_Switches ("WinRes")use
("--target=pe-x86-64");for
Leading_Required_Switches ("WinRes")use
("-i");for
Object_File_Suffix ("WinRes")use
".o";end
Compiler;package
Namingis
for
Body_Suffix ("WinRes")use
".rc";end
Naming;end
Portable.Windows;