samoht / assemblage

A collection of tools to manage the configuration of OCaml projects
54 stars 4 forks source link

Flags & Features #41

Closed dbuenzli closed 10 years ago

dbuenzli commented 10 years ago

Any particular reason why Flags can't be conditionalized on Features ? This could be very useful e.g. to inject flags ocamlbuild style.

samoht commented 10 years ago

In my mind, a Flags.t is the final result of the thing you'll pass the to compilers. You build a Flags.t by combining other flags together, by resolving external and internal names and so on. How do you want the conditionalizing to be done ?

If you think that could simplify your life, please do it :p

dbuenzli commented 10 years ago

Well simply by adding a Features.t argument to Flags.create. E.g.:

let optim = Features.create "optim" ~doc:"enable optimizations" in 
let optim_flags = Flags.create ~available:optim ~comp_native:[ "-inline"; "3"]

let unit = unit ~flags:optim_flags ...
samoht commented 10 years ago

Right I see. It indeed make sense!