Created
October 8, 2016 10:32
-
-
Save charlie5/898b08dae5e7577e4f25270e390fb4d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract | |
project Shared is | |
for Source_Files use (); | |
-- Scenario Variables | |
-- | |
type Os_Type is | |
("Windows_NT", "Linux", "MacOSX"); | |
Os : Os_Type := external ("OS"); | |
type Restrictions is | |
("xgc", "ravenscar"); | |
Restrictions : Restrictions := external ("restrictions"); | |
type Build_Mode_Type is | |
("debug", "fast", "small"); | |
Build_Mode : Build_Mode_Type := external ("Build_Mode", "debug"); | |
-- Declare various options. | |
-- | |
Binder_Options := (); | |
Style_Options := ("-gnatyaknp", -- Check casings: a:attribute, k:keywords, n:package Standard identifiers, p:pragma, r:identifier references. | |
"-gnatybfhi", -- Check b:no blanks at end of lines, f:no ff/vtabs, h: no htabs, i:if-then layout, u:no unnecessary blank lines. | |
"-gnatyO", -- Check that overriding subprograms are explicitly marked as such. | |
"-gnatye", -- Check that labels on end statements (ending subprograms), and on exit statements (exiting named loops), are present. | |
"-gnatyx"); -- Check x:no extra parens. | |
Compiler_Options := ("-gnat12", | |
"-gnatwa", | |
"-fno-strict-aliasing") | |
& Style_Options; | |
Fast_Options := ("-O2", | |
"-gnatn", | |
"-gnatp", | |
"-funroll-loops", | |
"-fpeel-loops", | |
"-ftracer", | |
"-funswitch-loops", | |
"-fweb", | |
"-frename-registers"); | |
Small_Options := ("-Os", | |
"-gnatp", | |
"-fno-inline", | |
"-march=i386", | |
"-ffunction-sections", | |
"-falign-jumps=0", | |
"-falign-loops=0", | |
"-falign-functions=0", | |
"-mpreferred-stack-boundary=2"); | |
-- Modify options to cater for the build mode. | |
-- | |
case Build_Mode | |
is | |
when "debug" => | |
Binder_Options := Binder_Options & "-E"; | |
Compiler_Options := Compiler_Options & "-gnato" | |
& "-fstack-check" | |
& "-g"; | |
case OS | |
is | |
when "Linux" => | |
Compiler_Options := Compiler_Options & "-gnatVa"; | |
when "Windows_NT" => | |
Compiler_Options := Compiler_Options & "-fno-inline" | |
& "-gnatVcdeimoprst"; | |
-- & "-gnatVf" -- (2016) turned off floating point validity check, seems to give false positives on a scalar product for collision detection | |
when "MacOSX" => | |
null; | |
end case; | |
when "fast" => | |
case OS | |
is | |
when "Linux" => | |
Compiler_Options := Compiler_Options & Fast_Options | |
& "-fomit-frame-pointer"; | |
when "Windows_NT" => | |
Compiler_Options := Compiler_Options & Fast_Options | |
& "-fipa-cp-clone" | |
& "-fgcse-after-reload" | |
& "-ftree-vectorize" | |
& "-mfpmath=sse" | |
& "-msse3"; | |
when "MacOSX" => | |
null; | |
end case; | |
when "small" => | |
case OS | |
is | |
when "Linux" => | |
Compiler_Options := Compiler_Options & Small_Options | |
& "-fdata-sections"; | |
when "Windows_NT" => | |
Compiler_Options := Compiler_Options & Small_Options; | |
when "MacOSX" => | |
null; | |
end case; | |
end case; | |
-- Modify options to cater for the operating system. | |
-- | |
case OS | |
is | |
when "MacOSX" => | |
Compiler_Options := Compiler_Options & "-gnatf" | |
& "-gnatE" | |
& "-gnatVcfimorst" | |
& "-gnatyhiknp"; | |
when "Linux" => | |
Binder_Options := Binder_Options & "-static"; | |
when "Windows_NT" => | |
null; | |
end case; | |
-- Define the packages. | |
-- | |
package Ide is | |
case OS | |
is | |
when "Linux" => for Default_Switches ("adacontrol") use ("-Ftgnat_short"); | |
when "Windows_NT" => for Default_Switches ("adacontrol") use ("-F", "gnat_short"); | |
when "MacOSX" => for Default_Switches ("adacontrol") use (); | |
end case; | |
end Ide; | |
package Builder is | |
for Default_Switches ("ada") use ("-C", "-j5"); | |
case Build_Mode | |
is | |
when "debug" => for Global_Configuration_Pragmas use "debug.pra"; | |
when "fast" => null; | |
when "small" => null; | |
end case; | |
end Builder; | |
package Compiler is | |
for Default_Switches ("ada") use Compiler_Options; | |
end Compiler; | |
package Binder is | |
for Default_Switches ("ada") use Binder_Options; | |
end Binder; | |
end Shared; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment