da59f5fc900290026e8abdc9e6197114269c5327
[hadrian.git] / src / Settings / Ways.hs
1 module Settings.Ways (getWays, getRtsWays) where
2
3 import Stage
4 import Expression
5 import Predicates
6 import Oracles
7 import Settings.User
8
9 -- Combining default ways with user modifications
10 getWays :: Expr [Way]
11 getWays = fromDiffExpr $ defaultWays <> userWays
12
13 getRtsWays :: Expr [Way]
14 getRtsWays = fromDiffExpr $ defaultRtsWays <> userRtsWays
15
16 -- These are default ways
17 defaultWays :: Ways
18 defaultWays = mconcat
19 [ append [vanilla] -- always build vanilla
20 , notStage Stage0 ? append [profiling]
21 , platformSupportsSharedLibs ? append [dynamic] ]
22
23 defaultRtsWays :: Ways
24 defaultRtsWays = do
25 ways <- getWays
26 mconcat
27 [ append [ logging, debug, threaded, threadedDebug, threadedLogging ]
28 , (profiling `elem` ways) ? append [threadedProfiling]
29 , (dynamic `elem` ways) ?
30 append [ dynamic, debugDynamic, threadedDynamic, threadedDebugDynamic
31 , loggingDynamic, threadedLoggingDynamic ] ]