Commit cc3113db authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Add getLibWays to capture context-less ways.

parent 28e3a26c
module Settings.User (
userArgs, userPackages, userWays, userRtsWays, userTargetDirectory,
userArgs, userPackages, userLibWays, userRtsWays, userTargetDirectory,
userKnownPackages, integerLibrary,
trackBuildSystem, buildHaddock, validating, ghciWithDebugger, ghcProfiled,
dynamicGhcPrograms, laxDependencies
ghcDebugged, dynamicGhcPrograms, laxDependencies
) where
import Expression
......@@ -21,9 +21,9 @@ userPackages = mempty
userKnownPackages :: [Package]
userKnownPackages = []
-- Control which ways are built
userWays :: Ways
userWays = mempty
-- Control which ways libraries and rts are built
userLibWays :: Ways
userLibWays = mempty
userRtsWays :: Ways
userRtsWays = mempty
......@@ -60,6 +60,10 @@ ghciWithDebugger = False
ghcProfiled :: Bool
ghcProfiled = False
-- TODO: do we need to be able to set this from command line?
ghcDebugged :: Bool
ghcDebugged = False
-- When laxDependencies flag is set to True, dependencies on the GHC executable
-- are turned into order-only dependencies to avoid needless recompilation when
-- making changes to GHC's sources. In certain situations this can lead to build
......
module Settings.Ways (getWays, getRtsWays) where
module Settings.Ways (getWays, getLibWays, getRtsWays) where
import Expression
import Predicates
import Settings.User
-- Combining default ways with user modifications
getLibWays :: Expr [Way]
getLibWays = fromDiffExpr $ defaultLibWays <> userLibWays
-- In Stage0 we only build vanilla
getWays :: Expr [Way]
getWays = fromDiffExpr $ defaultWays <> userWays
getWays = mconcat [ stage0 ? return [vanilla], notStage0 ? getLibWays ]
getRtsWays :: Expr [Way]
getRtsWays = fromDiffExpr $ defaultRtsWays <> userRtsWays
-- These are default ways
defaultWays :: Ways
defaultWays = mconcat
[ append [vanilla] -- always build vanilla
, notStage0 ? append [profiling]
defaultLibWays :: Ways
defaultLibWays = mconcat
[ append [vanilla, profiling]
, platformSupportsSharedLibs ? append [dynamic] ]
defaultRtsWays :: Ways
defaultRtsWays = do
ways <- getWays
ways <- getLibWays
mconcat
[ append [ logging, debug, threaded, threadedDebug, threadedLogging ]
, (profiling `elem` ways) ? append [threadedProfiling]
......
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