Skip to content

Commit

Permalink
Fix dependency on aaa and bump version to 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Jun 6, 2022
1 parent 132728f commit 65fb531
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 76 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
obj/
lib/
alire/
alire.lock
config/

/obj/
/lib/
/alire/
4 changes: 2 additions & 2 deletions alire.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "toml_slicer"
description = "Edit TOML files directly without parsing"
version = "0.1.0"
version = "0.1.1"
licenses = "MIT"
tags = ["toml"]

Expand All @@ -10,4 +10,4 @@ maintainers-logins = ["mosteo"]
website = "https://github.com/mosteo/toml_slicer"

[[depends-on]]
aaa = "~0.2.4"
aaa = "~0.2.4|~0.3"
19 changes: 19 additions & 0 deletions config/toml_slicer_config.ads
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- Configuration for toml_slicer generated by Alire
pragma Restrictions (No_Elaboration_Code);

package Toml_Slicer_Config is
pragma Pure;

Crate_Version : constant String := "0.1.1";
Crate_Name : constant String := "toml_slicer";

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 Toml_Slicer_Config;
23 changes: 23 additions & 0 deletions config/toml_slicer_config.gpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-- Configuration for toml_slicer generated by Alire
with "aaa.gpr";
abstract project Toml_Slicer_Config is
Crate_Version := "0.1.1";
Crate_Name := "toml_slicer";

Alire_Host_OS := "linux";

Alire_Host_Arch := "x86_64";

Alire_Host_Distro := "ubuntu";
Ada_Compiler_Switches := External_As_List ("ADAFLAGS", " ") &
(
"-O3" -- Optimize for performance
,"-gnatn" -- Enable inlining
,"-ffunction-sections" -- Separate ELF section for each function
,"-fdata-sections" -- Separate ELF section for each variable
);

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

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

#define CRATE_VERSION "0.1.1"
#define CRATE_NAME "toml_slicer"

#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
79 changes: 9 additions & 70 deletions toml_slicer.gpr
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
with "aaa";

with "config/toml_slicer_config.gpr";
project Toml_Slicer is

for Library_Name use "Toml_Slicer";
for Library_Version use "0.0.0";
for Library_Version use Project'Library_Name & ".so." & Toml_Slicer_Config.Crate_Version;

for Source_Dirs use ("src");
for Object_Dir use "obj";
for Source_Dirs use ("src/", "config/");
for Object_Dir use "obj/" & Toml_Slicer_Config.Build_Profile;
for Create_Missing_Dirs use "True";
for Library_Dir use "lib";

Expand All @@ -15,76 +14,16 @@ project Toml_Slicer is
external ("TOML_SLICER_LIBRARY_TYPE", external ("LIBRARY_TYPE", "static"));
for Library_Kind use Library_Type;

type Enabled_Kind is ("enabled", "disabled");
Compile_Checks : Enabled_Kind := External ("TOML_SLICER_COMPILE_CHECKS", "enabled");
Runtime_Checks : Enabled_Kind := External ("TOML_SLICER_RUNTIME_CHECKS", "enabled");
Style_Checks : Enabled_Kind := External ("TOML_SLICER_STYLE_CHECKS", "enabled");
Contracts_Checks : Enabled_Kind := External ("TOML_SLICER_CONTRACTS", "enabled");

type Build_Kind is ("debug", "optimize");
Build_Mode : Build_Kind := External ("TOML_SLICER_BUILD_MODE", "debug");

Compile_Checks_Switches := ();
case Compile_Checks is
when "enabled" =>
Compile_Checks_Switches :=
("-gnatwa", -- All warnings
"-gnatVa", -- All validity checks
"-gnatwe"); -- Warnings as errors
when others => null;
end case;

Runtime_Checks_Switches := ();
case Runtime_Checks is
when "enabled" => null;
when others =>
Runtime_Checks_Switches :=
("-gnatp"); -- Supress checks
end case;

Style_Checks_Switches := ();
case Style_Checks is
when "enabled" =>
Style_Checks_Switches :=
("-gnatyg", -- GNAT Style checks
"-gnaty-d", -- Disable no DOS line terminators
"-gnatyM80", -- Maximum line length
"-gnaty-s", -- Relax Fwd Declarations
"-gnatyO"); -- Overriding subprograms explicitly marked as such
when others => null;
end case;

Contracts_Switches := ();
case Contracts_Checks is
when "enabled" =>
Contracts_Switches :=
("-gnata"); -- Enable assertions and contracts
when others => null;
end case;

Build_Switches := ();
case Build_Mode is
when "optimize" =>
Build_Switches := ("-O3", -- Optimization
"-gnatn"); -- Enable inlining
when "debug" =>
Build_Switches := ("-g", -- Debug info
"-Og"); -- No optimization
end case;

package Compiler is
for Default_Switches ("Ada") use
Compile_Checks_Switches &
Build_Switches &
Runtime_Checks_Switches &
Style_Checks_Switches &
Contracts_Switches &
("-gnatw.X", -- Disable warnings for No_Exception_Propagation
"-gnatQ"); -- Don't quit. Generate ALI and tree files even if illegalities
for Default_Switches ("Ada") use Toml_Slicer_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 Toml_Slicer;

0 comments on commit 65fb531

Please # to comment.