This commit is contained in:
Jeremie Dimino 2017-03-06 15:14:57 +00:00
parent 7850bf67f5
commit cac1dc0e3e
3 changed files with 13 additions and 6 deletions

View File

@ -104,7 +104,10 @@ let dyn_paths t = Dyn_paths t
let contents p = Contents p
let lines_of p = Lines_of p
let fail x = Fail x
let fail ?targets x =
match targets with
| None -> Fail x
| Some l -> Targets l >>> Fail x
let files_recursively_in ~dir =
let ctx_dir, src_dir =

View File

@ -47,7 +47,7 @@ val lines_of : Path.t -> ('a, string list) t
(** Always fail when executed. We pass a function rather than an exception to get a proper
backtrace *)
val fail : fail -> (_, _) t
val fail : ?targets:Path.t list -> fail -> (_, _) t
module Prog_spec : sig
type 'a t =

View File

@ -643,7 +643,7 @@ module Gen(P : Params) = struct
>>>
Build.action t ~dir ~targets
| exception e ->
Build.fail { fail = fun () -> raise e }
Build.fail ~targets { fail = fun () -> raise e }
in
let build =
Build.record_lib_deps ~dir ~kind:dep_kind
@ -799,7 +799,8 @@ module Gen(P : Params) = struct
else [])
]
let target = String_with_vars.of_string "${@}"
let target_var = String_with_vars.of_string "${@}"
let root_var = String_with_vars.of_string "${ROOT}"
(* Generate rules to build the .pp files and return a new module map where all filenames
point to the .pp files *)
@ -816,8 +817,11 @@ module Gen(P : Params) = struct
Build.path src
>>>
Action_interpret.run
(With_stdout_to (target, action))
~dir:ctx.build_dir
(With_stdout_to
(target_var,
Chdir (root_var,
action)))
~dir
~dep_kind
~targets:[dst]
~deps:[Some src]))