Add test compiler option to test (#621)
[hadrian.git] / src / Settings / Packages / GhcCabal.hs
1 module Settings.Packages.GhcCabal (ghcCabalPackageArgs) where
2
3 import Hadrian.Haskell.Cabal
4
5 import Base
6 import Expression
7 import Utilities
8
9 ghcCabalPackageArgs :: Args
10 ghcCabalPackageArgs = stage0 ? package ghcCabal ? builder Ghc ? do
11 cabalDeps <- expr $ stage1Dependencies cabal
12 let bootDeps = cabalDeps \\ [integerGmp, integerSimple, mtl, parsec, text]
13 cabalVersion <- expr $ pkgVersion (unsafePkgCabalFile cabal) -- TODO: improve
14 mconcat
15 [ pure [ "-package " ++ pkgName pkg | pkg <- bootDeps ]
16 , arg "--make"
17 , arg "-j"
18 , pure ["-Wall", "-fno-warn-unused-imports", "-fno-warn-warnings-deprecations"]
19 , arg ("-DCABAL_VERSION=" ++ replace "." "," cabalVersion)
20 , arg "-DCABAL_PARSEC"
21 , arg "-DBOOTSTRAPPING"
22 , arg "-DMIN_VERSION_binary_0_8_0"
23 , arg "libraries/text/cbits/cbits.c"
24 , arg "-ilibraries/Cabal/Cabal"
25 , arg "-ilibraries/binary/src"
26 , arg "-ilibraries/filepath"
27 , arg "-ilibraries/hpc"
28 , arg "-ilibraries/mtl"
29 , arg "-ilibraries/text"
30 , arg "-Ilibraries/text/include"
31 , arg "-ilibraries/parsec/src" ]
32