From 68574b2521b29760ee0520381138405b63ea5714 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Thu, 31 Dec 2020 18:14:03 +0100 Subject: [PATCH] Add flag to postgrest.cabal to disable collecting coverage data --- postgrest.cabal | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/postgrest.cabal b/postgrest.cabal index 560b260bf3b..a6768845b77 100644 --- a/postgrest.cabal +++ b/postgrest.cabal @@ -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 @@ -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 @@ -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