UserSettings.hs 1.16 KB
Newer Older
Andrey Mokhov's avatar
Andrey Mokhov committed
1
module UserSettings (
2 3 4
    userSettings, userPackages, userWays,

    buildHaddock, validating
Andrey Mokhov's avatar
Andrey Mokhov committed
5 6 7 8
    ) where

import Base hiding (arg, args, Args)
import Oracles.Builder
9
import Ways
10
import Targets
11
import Switches
Andrey Mokhov's avatar
Andrey Mokhov committed
12
import Expression
13
import Settings.Util
Andrey Mokhov's avatar
Andrey Mokhov committed
14

15
-- No user-specific settings by default
Andrey Mokhov's avatar
Andrey Mokhov committed
16
userSettings :: Settings
17 18
userSettings = mempty

19 20
-- Control conditions of which packages get to be built
-- TODO: adding *new* packages is not possible (see knownPackages in Targets.hs)
21 22 23
userPackages :: Packages
userPackages = mempty

24
-- Control which ways are built
25 26 27
userWays :: Ways
userWays = mempty

28
-- User-defined predicates
29
-- TODO: migrate more predicates here from configuration files
30 31 32 33 34 35
buildHaddock :: Predicate
buildHaddock = return True

validating :: Predicate
validating = return False

36 37 38
-- Examples:
userSettings' :: Settings
userSettings' = mconcat
39
    [ package compiler     ? stage0 ? arg "foo"
Andrey Mokhov's avatar
Andrey Mokhov committed
40
    , builder (Ghc Stage0) ? remove ["-O2"]
41
    , builder GhcCabal     ? removeSub "--configure-option=CFLAGS" ["-Werror"] ]
Andrey Mokhov's avatar
Andrey Mokhov committed
42

43 44
userPackages' :: Packages
userPackages' = mconcat
45 46
    [ stage1 ? remove [cabal]
    ,          remove [compiler] ]
47 48 49

userWays' :: Ways
userWays' = remove [profiling]