Skip to content

Commit

Permalink
Add flag to postgrest.cabal to disable collecting coverage data
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangwalther committed Dec 31, 2020
1 parent 43e2bd7 commit 68574b2
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions postgrest.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ flag dev
manual: True
description: Development flags

flag hpc
default: True
manual: True
description: Enable HPC (dev only)

library
default-language: Haskell2010
default-extensions: OverloadedStrings
Expand Down Expand Up @@ -92,18 +97,20 @@ library
, wai-extra >= 3.0.19 && < 3.2
, wai-logger >= 2.3.2
, wai-middleware-static >= 0.8.1 && < 0.10
-- -fno-spec-constr may help keep compile time memory use in check,
-- see https://gitlab.haskell.org/ghc/ghc/issues/16017#note_219304
-- -optP-Wno-nonportable-include-path
-- prevents build failures on case-insensitive filesystems (macos),
-- see https://github.com/commercialhaskell/stack/issues/3918
ghc-options: -Werror -Wall -fwarn-identities
-fno-spec-constr -optP-Wno-nonportable-include-path

if flag(dev)
ghc-options: -O0 -Werror -Wall -fwarn-identities
-fno-spec-constr -optP-Wno-nonportable-include-path
-fhpc -hpcdir .hpc
ghc-options: -O0
if flag(hpc)
ghc-options: -fhpc -hpcdir .hpc
else
ghc-options: -O2 -Werror -Wall -fwarn-identities
-fno-spec-constr -optP-Wno-nonportable-include-path
-- -fno-spec-constr may help keep compile time memory use in check,
-- see https://gitlab.haskell.org/ghc/ghc/issues/16017#note_219304
-- -optP-Wno-nonportable-include-path
-- prevents build failures on case-insensitive filesystems (macos),
-- see https://github.com/commercialhaskell/stack/issues/3918
ghc-options: -O2

executable postgrest
default-language: Haskell2010
Expand Down Expand Up @@ -131,16 +138,17 @@ executable postgrest
, time >= 1.6 && < 1.11
, wai >= 3.2.1 && < 3.3
, warp >= 3.2.12 && < 3.4
if flag(dev)
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -I2"
-O0 -Werror -Wall -fwarn-identities
-fno-spec-constr -optP-Wno-nonportable-include-path
-fhpc -hpcdir .hpc
else
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -I2"
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -I2"
-O2 -Werror -Wall -fwarn-identities
-fno-spec-constr -optP-Wno-nonportable-include-path

if flag(dev)
ghc-options: -O0
if flag(hpc)
ghc-options: -fhpc -hpcdir .hpc
else
ghc-options: -O2

if !os(windows)
build-depends: unix
other-modules: UnixSocket
Expand Down

0 comments on commit 68574b2

Please sign in to comment.