Commit 6508f4b9 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Add perf flavour

parent 374b10aa
......@@ -85,6 +85,7 @@ executable hadrian
, Settings.Builders.Make
, Settings.Builders.Tar
, Settings.Default
, Settings.Flavours.Perf
, Settings.Flavours.Quick
, Settings.Flavours.Quickest
, Settings.Packages.Base
......
......@@ -14,6 +14,7 @@ import GHC
import Oracles.PackageData
import Oracles.Path
import {-# SOURCE #-} Settings.Default
import Settings.Flavours.Perf
import Settings.Flavours.Quick
import Settings.Flavours.Quickest
import Settings.Path
......@@ -50,7 +51,7 @@ getPkgDataList :: (FilePath -> PackageDataList) -> Expr [String]
getPkgDataList key = lift . pkgDataList . key =<< getBuildPath
hadrianFlavours :: [Flavour]
hadrianFlavours = [defaultFlavour, quickFlavour, quickestFlavour]
hadrianFlavours = [defaultFlavour, perfFlavour, quickFlavour, quickestFlavour]
flavour :: Flavour
flavour = fromMaybe unknownFlavour $ find ((== flavourName) . name) flavours
......
module Settings.Flavours.Perf (perfFlavour) where
import Context
import Flavour
import GHC
import Predicate
import {-# SOURCE #-} Settings.Default
perfFlavour :: Flavour
perfFlavour = defaultFlavour
{ name = "perf"
, args = defaultArgs <> perfArgs }
optimise :: Context -> Bool
optimise Context {..} =
package `elem` [compiler, ghc] && stage == Stage2 || isLibrary package
perfArgs :: Args
perfArgs = builder Ghc ? do
context <- getContext
if optimise context then arg "-O2" else arg "-O"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment