Ada 编程/平台/可移植构建
外观
GPRbuild 可用于构建可移植的构建。
为所有支持平台通用的平台无关代码创建项目。
portable.gpr
projectPortableisforMainuse("portable.adb"); -- GPS uses this to start the executableforExec_Diruse"bin";forSource_Dirs use ("src");endPortable;
例如,使用 GPS 或 GPRbuild 打开 portable-windows.gpr 以构建 Windows 项目。
portable-windows.gpr
projectPortable.Windowsextends"portable.gpr"is-- Object for Windows ResourcesforLanguagesuse("Ada", "WinRes");forSource_Dirsuse("windows", "resources");forObject_Diruse"windows-obj"; -- This should be the same as the parent project -- or the executable will be placed on the object directoryforExec_Diruse"bin";packageLinkerisfor Default_Switches ("Ada") use ("-lgdi32", "windows-obj/resources.o", "-mwindows");endLinker;packageCompilerisforDriver ("WinRes")use"windres";forDefault_Switches ("WinRes")use("--target=pe-x86-64");forLeading_Required_Switches ("WinRes")use("-i");forObject_File_Suffix ("WinRes")use".o";endCompiler;packageNamingisforBody_Suffix ("WinRes")use".rc";endNaming;endPortable.Windows;
