Skip to content

Commit

Permalink
Fix packaging of Ada LZMA for Alire
Browse files Browse the repository at this point in the history
  • Loading branch information
stcarrez committed Jul 3, 2022
1 parent 24a9845 commit f74f024
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 2 deletions.
78 changes: 78 additions & 0 deletions .alire/lzma_config.gpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
abstract project Lzma_Config is
for Source_Dirs use ();

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

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

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

Processors := External ("PROCESSORS", "1");

package Builder is
for Default_Switches ("Ada") use ("-j" & Processors);
end Builder;

package compiler is
warnings := ("-gnatwua");
defaults := ("-gnat2012");
case Mode is
when "distrib" =>
for Default_Switches ("Ada") use defaults & ("-O2", "-gnatafno", "-gnatVa", "-gnatwa");

when "debug" =>
for Default_Switches ("Ada") use defaults & warnings
& ("-g", "-gnata", "-gnatVaMI", "-gnaty3abcefhiklmnprstxM99");

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

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

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

end case;
end compiler;

package binder is
case Mode is
when "debug" =>
for Default_Switches ("Ada") use ("-E");

when others =>
for Default_Switches ("Ada") use ("-E");

end case;
end binder;

package linker is
case Mode is
when "profile" =>
for Default_Switches ("Ada") use ("-pg");

when "distrib" =>
for Default_Switches ("Ada") use ("-s");

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

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

when others =>
null;
end case;

end linker;

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

end Lzma_Config;
4 changes: 2 additions & 2 deletions .alire/lzmada.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ library project LzmAda is
for Library_Kind use Library_Type;
for Library_Version use "lib" & Project'Library_Name & ".so." & Version;

for Library_Dir use "lib/lzmada/" & Project'Library_Kind;
for Object_Dir use "obj/lzmada/" & Project'Library_Kind;
for Library_Dir use "../lib/lzmada/" & Project'Library_Kind;
for Object_Dir use "../obj/lzmada/" & Project'Library_Kind;

package Builder renames Lzma_Config.Builder;
package Compiler renames Lzma_Config.Compiler;
Expand Down

0 comments on commit f74f024

Please sign in to comment.