Skip to content

Commit

Permalink
Alire metadata, enable config
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Aug 31, 2022
1 parent 65725c2 commit 5715870
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ obj

# Ada Library Information
*.ali
/obj/
/bin/
/alire/
/config/
/obj/
/bin/
/alire/
/config/
15 changes: 15 additions & 0 deletions alire.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name = "hello"
description = "'Hello, world!' demonstration project"
version = "1.0.2"
tags = ["hello", "demo"]
licenses = "MIT"
website = "https://github.com/alire-project/hello"

authors = ["Alejandro R. Mosteo"]
maintainers = ["Alejandro R. Mosteo <[email protected]>"]
maintainers-logins = ["mosteo"]

executables = ["hello"]

[[depends-on]]
libhello = "^1.0"
20 changes: 20 additions & 0 deletions config/hello_config.ads
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- Configuration for hello generated by Alire
pragma Restrictions (No_Elaboration_Code);
pragma Style_Checks (Off);

package Hello_Config is
pragma Pure;

Crate_Version : constant String := "1.0.2";
Crate_Name : constant String := "hello";

Alire_Host_OS : constant String := "linux";

Alire_Host_Arch : constant String := "x86_64";

Alire_Host_Distro : constant String := "ubuntu";

type Build_Profile_Kind is (release, validation, development);
Build_Profile : constant Build_Profile_Kind := release;

end Hello_Config;
50 changes: 50 additions & 0 deletions config/hello_config.gpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
-- Configuration for hello generated by Alire
with "libhello.gpr";
abstract project Hello_Config is
Crate_Version := "1.0.2";
Crate_Name := "hello";

Alire_Host_OS := "linux";

Alire_Host_Arch := "x86_64";

Alire_Host_Distro := "ubuntu";
Ada_Compiler_Switches := External_As_List ("ADAFLAGS", " ");
Ada_Compiler_Switches := Ada_Compiler_Switches &
(
"-Og" -- Optimize for debug
,"-ffunction-sections" -- Separate ELF section for each function
,"-fdata-sections" -- Separate ELF section for each variable
,"-g" -- Generate debug info
,"-gnatwa" -- Enable all warnings
,"-gnatw.X" -- Disable warnings for No_Exception_Propagation
,"-gnatVa" -- All validity checks
,"-gnaty3" -- Specify indentation level of 3
,"-gnatya" -- Check attribute casing
,"-gnatyA" -- Use of array index numbers in array attributes
,"-gnatyB" -- Check Boolean operators
,"-gnatyb" -- Blanks not allowed at statement end
,"-gnatyc" -- Check comments
,"-gnaty-d" -- Disable check no DOS line terminators present
,"-gnatye" -- Check end/exit labels
,"-gnatyf" -- No form feeds or vertical tabs
,"-gnatyh" -- No horizontal tabs
,"-gnatyi" -- Check if-then layout
,"-gnatyI" -- check mode IN keywords
,"-gnatyk" -- Check keyword casing
,"-gnatyl" -- Check layout
,"-gnatym" -- Check maximum line length
,"-gnatyn" -- Check casing of entities in Standard
,"-gnatyO" -- Check that overriding subprograms are explicitly marked as such
,"-gnatyp" -- Check pragma casing
,"-gnatyr" -- Check identifier references casing
,"-gnatyS" -- Check no statements after THEN/ELSE
,"-gnatyt" -- Check token spacing
,"-gnatyu" -- Check unnecessary blank lines
,"-gnatyx" -- Check extra parentheses
);

type Build_Profile_Kind is ("release", "validation", "development");
Build_Profile : Build_Profile_Kind := "release";

end Hello_Config;
20 changes: 20 additions & 0 deletions config/hello_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* Configuration for hello generated by Alire */
#ifndef HELLO_CONFIG_H
#define HELLO_CONFIG_H

#define CRATE_VERSION "1.0.2"
#define CRATE_NAME "hello"

#define ALIRE_HOST_OS "linux"

#define ALIRE_HOST_ARCH "x86_64"

#define ALIRE_HOST_DISTRO "ubuntu"

#define BUILD_PROFILE_RELEASE 1
#define BUILD_PROFILE_VALIDATION 2
#define BUILD_PROFILE_DEVELOPMENT 3

#define BUILD_PROFILE 1

#endif
22 changes: 17 additions & 5 deletions hello.gpr
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
with "libhello.gpr";

with "config/hello_config.gpr";
project Hello is

for Source_Dirs use ("src");
for Object_Dir use "obj";
for Source_Dirs use ("src/", "config/");
for Object_Dir use "obj/" & Hello_Config.Build_Profile;
for Create_Missing_Dirs use "True";
for Exec_Dir use "bin";
for Main use ("hello.adb");

end Hello;
package Compiler is
for Default_Switches ("Ada") use Hello_Config.Ada_Compiler_Switches;
end Compiler;

package Binder is
for Switches ("Ada") use ("-Es"); -- Symbolic traceback
end Binder;

package Install is
for Artifacts (".") use ("share");
end Install;

end Hello;

0 comments on commit 5715870

Please sign in to comment.