Skip to content

Commit

Permalink
Fix GNAT project (merge from config.gpr of Ada Util)
Browse files Browse the repository at this point in the history
  • Loading branch information
stcarrez committed May 15, 2021
1 parent 8aacd3b commit fb242fe
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions mat/mat_config.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ abstract project Mat_Config is

type Yes_No is ("yes", "no");

type Library_Type_Type is ("relocatable", "static");
type Library_Type_Type is ("relocatable", "static", "static-pic");

type Mode_Type is ("distrib", "debug", "optimize", "profile");
Mode : Mode_Type := external ("MODE", "debug");
type Build_Type is ("distrib", "debug", "optimize", "profile", "coverage");
Mode : Build_Type := external ("BUILD", "debug");

Coverage : Yes_No := External ("COVERAGE", "no");
Processors := External ("PROCESSORS", "1");

package Builder is
Expand All @@ -31,19 +30,18 @@ abstract project Mat_Config is
for Default_Switches ("Ada") use defaults & warnings
& ("-gnata", "-gnatVaMI", "-gnaty3abcefhiklmnprstxM99");

when "coverage" =>
for Default_Switches ("Ada") use defaults & warnings
& ("-gnata", "-gnatVaMI", "-gnaty3abcefhiklmnprstxM99",
"-fprofile-arcs", "-ftest-coverage");

when "optimize" =>
for Default_Switches ("Ada") use defaults & warnings
& ("-gnatn", "-gnatp", "-fdata-sections", "-ffunction-sections");

when "profile" =>
for Default_Switches ("Ada") use defaults & warnings & ("-pg");
end case;

case Coverage is
when "yes" =>
for Default_Switches ("ada") use Compiler'Default_Switches ("Ada") &
("-fprofile-arcs", "-ftest-coverage");
when others =>
end case;
end compiler;

Expand All @@ -68,21 +66,18 @@ abstract project Mat_Config is

when "optimize" =>
for Default_Switches ("Ada") use ("-Wl,--gc-sections");

when "coverage" =>
for Default_Switches ("ada") use ("-fprofile-arcs");

when others =>
null;
end case;

case Coverage is
when "yes" =>
for Default_Switches ("ada") use Linker'Default_Switches ("ada") &
("-fprofile-arcs");
when others =>
end case;
end linker;

package Ide is
for VCS_Kind use "Subversion";
for VCS_Kind use "git";
end Ide;

end Mat_Config;

0 comments on commit fb242fe

Please sign in to comment.