forked from pa-ba/Rattus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Setup.hs
29 lines (24 loc) · 872 Bytes
/
Setup.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{-
Disable some errors and warnings during the haddock pass
(caused by compiler plugins and hs-boot)
-}
{-# OPTIONS_GHC -Wall #-}
module Main (main) where
import Distribution.Simple
import Distribution.Simple.Setup
main :: IO ()
main = defaultMainWithHooks simpleUserHooks
{ confHook = \a -> confHook simpleUserHooks a . tweakFlags }
tweakFlags :: ConfigFlags -> ConfigFlags
tweakFlags flags = flags
{ configProgramArgs = addHaddockArgs (configProgramArgs flags) }
addHaddockArgs :: [(String, [String])] -> [(String, [String])]
addHaddockArgs []
= [("haddock", newHaddockGhcArgs)]
addHaddockArgs (("haddock", args):otherProgsArgs)
= ("haddock", args ++ newHaddockGhcArgs) : otherProgsArgs
addHaddockArgs (progArgs:otherProgsArgs)
= progArgs : addHaddockArgs otherProgsArgs
newHaddockGhcArgs :: [String]
newHaddockGhcArgs =
[ "--optghc=-fobject-code" ]