summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/doc/flavours.md12
-rw-r--r--hadrian/hadrian.cabal1
-rw-r--r--hadrian/src/Flavour.hs13
-rwxr-xr-xhadrian/src/Settings.hs2
-rw-r--r--hadrian/src/Settings/Flavours/Release.hs7
5 files changed, 35 insertions, 0 deletions
diff --git a/hadrian/doc/flavours.md b/hadrian/doc/flavours.md
index f0d34ddc90..b0df22272b 100644
--- a/hadrian/doc/flavours.md
+++ b/hadrian/doc/flavours.md
@@ -100,6 +100,18 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH
<td>-O2</td>
</tr>
<tr>
+ <th>release (same as perf with -haddock)</td>
+ <td> Yes (on supported platforms) </td>
+ <td>-O<br>-H64m</td>
+ <td>-O<br>-H64m</td>
+ <td></td>
+ <td>-O2</td>
+ <td>-O2</td>
+ <td>-O2</td>
+ <td>-O</td>
+ <td>-O2</td>
+ </tr>
+ <tr>
<th>bench</td>
<td>-O<br>-H64m</td>
<td>-O<br>-H64m</td>
diff --git a/hadrian/hadrian.cabal b/hadrian/hadrian.cabal
index e181615d13..7ddacb4b9b 100644
--- a/hadrian/hadrian.cabal
+++ b/hadrian/hadrian.cabal
@@ -117,6 +117,7 @@ executable hadrian
, Settings.Flavours.QuickCross
, Settings.Flavours.Quickest
, Settings.Flavours.Validate
+ , Settings.Flavours.Release
, Settings.Packages
, Settings.Parser
, Settings.Program
diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs
index f0ebacd7f2..057297dcc6 100644
--- a/hadrian/src/Flavour.hs
+++ b/hadrian/src/Flavour.hs
@@ -12,6 +12,7 @@ module Flavour
, enableProfiledGhc
, disableDynamicGhcPrograms
, disableProfiledLibs
+ , enableHaddock
, completeSetting
, applySettings
@@ -49,6 +50,7 @@ flavourTransformers = M.fromList
, "fully_static" =: fullyStatic
, "collect_timings" =: collectTimings
, "assertions" =: enableAssertions
+ , "haddock" =: enableHaddock
]
where (=:) = (,)
@@ -127,6 +129,17 @@ enableTickyGhc =
, arg "-ddump-stg-final"
]
+-- | Enable Core, STG, and C-- linting in all compilations with the stage1 compiler.
+enableHaddock :: Flavour -> Flavour
+enableHaddock =
+ addArgs $ stage1 ? mconcat
+ [ builder (Ghc CompileHs) ? haddock
+ ]
+ where
+ haddock = mconcat
+ [ arg "-haddock"
+ ]
+
-- | Transform the input 'Flavour' so as to build with
-- @-split-sections@ whenever appropriate. You can
-- select which package gets built with split sections
diff --git a/hadrian/src/Settings.hs b/hadrian/src/Settings.hs
index 50ef988036..6b756c21ae 100755
--- a/hadrian/src/Settings.hs
+++ b/hadrian/src/Settings.hs
@@ -22,6 +22,7 @@ import Settings.Flavours.Quick
import Settings.Flavours.Quickest
import Settings.Flavours.QuickCross
import Settings.Flavours.Validate
+import Settings.Flavours.Release
getArgs :: Args
@@ -52,6 +53,7 @@ hadrianFlavours :: [Flavour]
hadrianFlavours =
[ benchmarkFlavour, defaultFlavour, developmentFlavour Stage1
, developmentFlavour Stage2, performanceFlavour
+ , releaseFlavour
, quickFlavour, quickValidateFlavour, quickDebugFlavour
, quickestFlavour
, quickCrossFlavour
diff --git a/hadrian/src/Settings/Flavours/Release.hs b/hadrian/src/Settings/Flavours/Release.hs
new file mode 100644
index 0000000000..2f3daadae1
--- /dev/null
+++ b/hadrian/src/Settings/Flavours/Release.hs
@@ -0,0 +1,7 @@
+module Settings.Flavours.Release where
+
+import Settings.Flavours.Performance
+import Flavour
+
+releaseFlavour :: Flavour
+releaseFlavour = enableHaddock performanceFlavour { name = "release" }