Commit 4a60bb9f authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

More comments for the modular solver.


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 3d4db709
......@@ -169,8 +169,13 @@ type FlaggedDeps comp qpn = [FlaggedDep comp qpn]
-- | Flagged dependencies can either be plain dependency constraints,
-- or flag-dependent dependency trees.
data FlaggedDep comp qpn =
-- | Dependencies which are conditional on a flag choice.
Flagged (FN qpn) FInfo (TrueFlaggedDeps qpn) (FalseFlaggedDeps qpn)
-- | Dependencies which are conditional on whether or not a stanza
-- (e.g., a test suite or benchmark) is enabled.
| Stanza (SN qpn) (TrueFlaggedDeps qpn)
-- | Dependencies for which are always enabled, for the component
-- 'comp' (or requested for the user, if comp is @()@).
| Simple (Dep qpn) comp
deriving (Eq, Show)
......
......@@ -113,17 +113,18 @@ convGPD os arch cinfo strfl pi
CondTree ConfVar [Dependency] a -> FlaggedDeps Component PN
conv comp getInfo = convCondTree os arch cinfo pi fds comp getInfo .
PDC.addBuildableCondition getInfo
flagged_deps
= concatMap (\(nm, ds) -> conv (ComponentLib nm) libBuildInfo ds) libs
++ concatMap (\(nm, ds) -> conv (ComponentExe nm) buildInfo ds) exes
++ prefix (Stanza (SN pi TestStanzas))
(L.map (\(nm, ds) -> conv (ComponentTest nm) testBuildInfo ds) tests)
++ prefix (Stanza (SN pi BenchStanzas))
(L.map (\(nm, ds) -> conv (ComponentBench nm) benchmarkBuildInfo ds) benchs)
++ maybe [] (convSetupBuildInfo pi) (setupBuildInfo pkg)
in
PInfo
(concatMap (\(nm, ds) -> conv (ComponentLib nm) libBuildInfo ds) libs ++
maybe [] (convSetupBuildInfo pi) (setupBuildInfo pkg) ++
concatMap (\(nm, ds) -> conv (ComponentExe nm) buildInfo ds) exes ++
prefix (Stanza (SN pi TestStanzas))
(L.map (\(nm, ds) -> conv (ComponentTest nm) testBuildInfo ds) tests) ++
prefix (Stanza (SN pi BenchStanzas))
(L.map (\(nm, ds) -> conv (ComponentBench nm) benchmarkBuildInfo ds) benchs))
fds
Nothing
PInfo flagged_deps fds Nothing
prefix :: (FlaggedDeps comp qpn -> FlaggedDep comp' qpn) -> [FlaggedDeps comp qpn] -> FlaggedDeps comp' qpn
prefix _ [] = []
......
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