-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctional.gpr
More file actions
143 lines (127 loc) · 6.21 KB
/
functional.gpr
File metadata and controls
143 lines (127 loc) · 6.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
with "config/functional_config.gpr";
project Functional is
for Library_Name use "functional";
for Library_Version use Project'Library_Name & ".so." & Functional_Config.Crate_Version;
for Source_Dirs use ("src/**", "config/");
for Object_Dir use "obj/" & Functional_Config.Build_Profile;
for Create_Missing_Dirs use "True";
for Library_Dir use "lib";
type Library_Type_Type is ("relocatable", "static", "static-pic");
Library_Type : Library_Type_Type :=
external ("FUNCTIONAL_LIBRARY_TYPE", external ("LIBRARY_TYPE", "static"));
for Library_Kind use Library_Type;
-- =======================================================================
-- Stand-Alone Library Configuration - PUBLIC API ENFORCEMENT
-- =======================================================================
--
-- All packages are public (this is a utility library):
-- - Functional Root package
-- - Functional.Result Result<T,E> monad for error handling
-- - Functional.Option Option<T> monad for optional values
-- - Functional.Either Either<L,R> disjoint union type
-- - Functional.Try Exception-to-monad bridge
-- - Functional.Scoped RAII resource guards (finalization-based)
-- - Functional.Version Library version information
-- - Functional_Config Build configuration
--
-- ENFORCED BY:
-- - Library_Standalone: Enables stand-alone library mode
-- - Library_Interface: Explicitly lists ONLY public packages
-- - GPRbuild: Prevents clients from accessing non-listed packages
-- =======================================================================
for Library_Standalone use "standard";
for Library_Interface use
("Functional_Config",
"Functional",
"Functional.Result",
"Functional.Option",
"Functional.Either",
"Functional.Try",
"Functional.Try.To_Option",
"Functional.Try.To_Result",
"Functional.Try.Map_To_Result",
"Functional.Try.Map_To_Result_With_Param",
"Functional.Scoped",
"Functional.Version");
-- ==========================================================================
-- Compiler Package: Ada 2022 Standards and Best Practices
-- ==========================================================================
package Compiler is
-- Common switches applied to all build modes
Common_Switches := (
"-gnat2022", -- Ada 2022 mode
"-gnatwa", -- All warnings
"-gnatw.Y", -- Disable warnings from system units
"-gnatwl", -- Elaboration warnings
"-gnatwu", -- Unused entities warnings
"-gnatw.u", -- Unreferenced entities
"-gnatw.r", -- Redundant constructs
"-gnatw.k", -- Variable could be constant
"-gnatw.m", -- Variable assigned but never read
"-gnatw.o", -- Modified but unreferenced out parameters
"-gnatw.X", -- Disable warnings on local exception propagation
"-gnatf", -- Full error messages
-- Style checks (Ada Quality and Style Guide)
"-gnatyy", -- Enable default style checks
"-gnaty3", -- Check indentation of 3 spaces
"-gnatya", -- Check attribute casing
"-gnatyb", -- Check blanks at end of lines
"-gnatyc", -- Check comment format
"-gnatyd", -- Check no DOS line terminators
"-gnatye", -- Check end labels
"-gnatyf", -- Check form feeds/vertical tabs
"-gnatyh", -- Check horizontal tabs
"-gnatyi", -- Check if-then layout
"-gnatyk", -- Check keyword casing
"-gnatyl", -- Check layout
"-gnatym", -- Check line length <= 79 (overridden by -gnatyM120)
"-gnatyn", -- Check casing of entities in Standard
"-gnatyp", -- Check pragma casing
"-gnatyr", -- Check references
"-gnatys", -- Check separate specs
"-gnatyt", -- Check token spacing
"-gnatyu", -- Check unnecessary blank lines
"-gnatyx", -- Check extra parentheses
"-gnatyM120", -- Maximum line length of 120 characters
"-gnatyN", -- Check casing of predefined identifiers
"-gnatyO", -- Check overriding indicators
"-gnatyS", -- Check no statements on same line as THEN or ELSE
"-gnatW8" -- UTF-8 encoding
);
for Default_Switches ("Ada") use Common_Switches & (
"-g", -- Debug info
"-gnatVa", -- All validity checks
"-gnateE", -- Extra info in exceptions
"-gnata", -- Enable assertions and contracts
"-gnatU", -- Tag uninitialized scalars
"-gnatd.n" -- Activate front-end inlining
);
end Compiler;
-- ==========================================================================
-- Binder Package: Runtime Configuration
-- ==========================================================================
package Binder is
for Default_Switches ("Ada") use (
"-Es", -- Symbolic traceback
"-E" -- Store tracebacks in exceptions
);
end Binder;
-- ==========================================================================
-- Builder Package: Build Process Configuration
-- ==========================================================================
package Builder is
for Default_Switches ("Ada") use (
"-j0", -- Use all available cores (0 = auto-detect)
"-s" -- Recompile if compiler switches change
);
end Builder;
-- ==========================================================================
-- Format Package: Code Formatting Configuration
-- ==========================================================================
package Format is
for Configuration use ".gnatformat.yaml";
end Format;
package Install is
for Artifacts (".") use ("share");
end Install;
end Functional;