Skip to content
Snippets Groups Projects
Commit afc39ff5 authored by Ben Gamari's avatar Ben Gamari
Browse files

hadrian: Pass -Werror before other arguments

Previously we would append -Werror to the argument list. However, this
ended up overriding the -Wno-error=... flags in Settings.Warnings.
parent b3cc6847
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ module Flavour
( Flavour (..), werror
, DocTargets, DocTarget(..)
-- * Flavour transformers
, addArgs
, addArgs, addArgsBefore
, splitSections, splitSectionsIf
, enableThreadSanitizer
, enableDebugInfo, enableTickyGhc
......@@ -71,10 +71,15 @@ data DocTarget = Haddocks | SphinxHTML | SphinxPDFs | SphinxMan | SphinxInfo
addArgs :: Args -> Flavour -> Flavour
addArgs args' fl = fl { args = args fl <> args' }
addArgsBefore :: Args -> Flavour -> Flavour
addArgsBefore args' fl = fl { args = args' <> args fl }
-- | 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 = addArgs (builder Ghc ? notStage0 ? arg "-Werror")
werror = addArgsBefore (builder Ghc ? notStage0 ? arg "-Werror")
-- N.B. We add this flag *before* the others to ensure that we don't override
-- the -Wno-error flags defined in "Settings.Warnings".
-- | Build C and Haskell objects with debugging information.
enableDebugInfo :: Flavour -> Flavour
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment