summaryrefslogtreecommitdiff
path: root/hadrian/src/Flavour.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2019-01-31 11:01:04 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-02-03 14:20:27 -0500
commit8dcd00cef7782c64b5484b106f4fd77c8c87e40a (patch)
tree7e884bfee261296997d6fa2254d311425b5c61bd /hadrian/src/Flavour.hs
parent59516e4bbfc0baaa71c83fcd4493c27c422e5d57 (diff)
downloadhaskell-8dcd00cef7782c64b5484b106f4fd77c8c87e40a.tar.gz
Add werror function to Flavour.hs
This function makes it easy to turn on `-Werror` in the correct manner to mimic how CI turns on -Werror.
Diffstat (limited to 'hadrian/src/Flavour.hs')
-rw-r--r--hadrian/src/Flavour.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs
index e95e0d7e1f..23e2aa8a81 100644
--- a/hadrian/src/Flavour.hs
+++ b/hadrian/src/Flavour.hs
@@ -1,4 +1,4 @@
-module Flavour (Flavour (..)) where
+module Flavour (Flavour (..), werror) where
import Expression
@@ -32,3 +32,9 @@ data Flavour = Flavour {
ghcProfiled :: Bool,
-- | Build GHC with debug information.
ghcDebugged :: Bool }
+
+
+-- | Turn on -Werror for packages built with the stage1 compiler.
+-- It mimics the CI settings so is useful to turn on when developing.
+werror :: Flavour -> Flavour
+werror fl = fl { args = args fl <> (builder Ghc ? notStage0 ? arg "-Werror") }