summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorCheng Shao <astrohavoc@gmail.com>2022-11-07 08:38:36 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-11-11 00:26:55 -0500
commitf5dfd1b48f82d08d7346a1988ec08ec3544c940c (patch)
tree8ae365aa3e4aa5f854d0b80ce57dda9147712b1a /hadrian
parent2829fd9257abc1b78ebd27692de96fb74c6afcfa (diff)
downloadhaskell-f5dfd1b48f82d08d7346a1988ec08ec3544c940c.tar.gz
hadrian: add -Wwarn only for cross-compiling unix
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/src/Flavour.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs
index 88ce819147..b13cb2f365 100644
--- a/hadrian/src/Flavour.hs
+++ b/hadrian/src/Flavour.hs
@@ -113,7 +113,17 @@ addArgs args' fl = fl { args = args fl <> args' }
-- in unix and/or hsc2hs to make cross-compiling unix completely free
-- from warnings.
werror :: Flavour -> Flavour
-werror = addArgs (builder Ghc ? notStage0 ? mconcat [arg "-Werror", flag CrossCompiling ? mconcat [arg "-Wwarn=unused-imports", arg "-Wwarn=unused-top-binds"]])
+werror =
+ addArgs
+ ( builder Ghc
+ ? notStage0
+ ? mconcat
+ [ arg "-Werror",
+ flag CrossCompiling
+ ? package unix
+ ? mconcat [arg "-Wwarn=unused-imports", arg "-Wwarn=unused-top-binds"]
+ ]
+ )
-- | Build C and Haskell objects with debugging information.
enableDebugInfo :: Flavour -> Flavour