Skip to content

Commit 1cada63

Browse files
committed
Add a Wall flag to enable all warnings, if desired
1 parent c86a7e8 commit 1cada63

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

vector.cabal

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ Flag InternalChecks
9393
Default: False
9494
Manual: True
9595

96+
Flag Wall
97+
Description: Enable all -Wall warnings
98+
Default: False
99+
Manual: True
96100

97101
Library
98102
Default-Language: Haskell2010
@@ -154,10 +158,13 @@ Library
154158
if !impl(ghc > 8.0)
155159
Build-Depends: semigroups >= 0.18 && < 0.19
156160

157-
Ghc-Options: -O2 -Wall -fno-warn-orphans
161+
Ghc-Options: -O2 -Wall
162+
163+
if !flag(Wall)
164+
Ghc-Options: -fno-warn-orphans
158165

159-
if impl(ghc >= 8.0) && impl( ghc < 8.1)
160-
Ghc-Options: -Wno-redundant-constraints
166+
if impl(ghc >= 8.0) && impl(ghc < 8.1)
167+
Ghc-Options: -Wno-redundant-constraints
161168

162169
if flag(BoundsChecks)
163170
cpp-options: -DVECTOR_BOUNDS_CHECKS
@@ -195,9 +202,12 @@ test-suite vector-tests-O0
195202
TemplateHaskell
196203

197204
Ghc-Options: -O0
198-
Ghc-Options: -Wall -fno-warn-orphans -fno-warn-missing-signatures
199-
if impl(ghc >= 8.0) && impl( ghc < 8.1)
200-
Ghc-Options: -Wno-redundant-constraints
205+
Ghc-Options: -Wall
206+
207+
if !flag(Wall)
208+
Ghc-Options: -fno-warn-orphans -fno-warn-missing-signatures
209+
if impl(ghc >= 8.0) && impl( ghc < 8.1)
210+
Ghc-Options: -Wno-redundant-constraints
201211

202212

203213
test-suite vector-tests-O2
@@ -220,8 +230,10 @@ test-suite vector-tests-O2
220230
TypeFamilies,
221231
TemplateHaskell
222232

223-
Ghc-Options: -O2
224-
if impl(ghc >= 8.0) && impl( ghc < 8.1)
225-
Ghc-Options: -Wno-redundant-constraints
233+
Ghc-Options: -O2 -Wall
234+
235+
if !flag(Wall)
236+
Ghc-Options: -fno-warn-orphans -fno-warn-missing-signatures
237+
if impl(ghc >= 8.0) && impl(ghc < 8.1)
238+
Ghc-Options: -Wno-redundant-constraints
226239

227-
Ghc-Options: -Wall -fno-warn-orphans -fno-warn-missing-signatures

0 commit comments

Comments
 (0)