UserSettings.hs 947 Bytes
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
13
import Expression

14
-- No user-specific settings by default
Andrey Mokhov's avatar
Andrey Mokhov committed
15
userSettings :: Settings
16
17
18
19
20
21
22
23
userSettings = mempty

userPackages :: Packages
userPackages = mempty

userWays :: Ways
userWays = mempty

24
25
26
27
28
29
30
-- User-defined predicates
buildHaddock :: Predicate
buildHaddock = return True

validating :: Predicate
validating = return False

31
32
33
-- Examples:
userSettings' :: Settings
userSettings' = mconcat
34
    [ package compiler     ? stage0 ? append ["foo", "bar"]
Andrey Mokhov's avatar
Andrey Mokhov committed
35
    , builder (Ghc Stage0) ? remove ["-O2"]
36
    , builder GhcCabal     ? removeSub "--configure-option=CFLAGS" ["-Werror"] ]
Andrey Mokhov's avatar
Andrey Mokhov committed
37

38
39
userPackages' :: Packages
userPackages' = mconcat
40
41
    [ stage1 ? remove [cabal]
    ,          remove [compiler] ]
42
43
44

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