Add a few more actions
Just enough to handle the common cases.
This commit is contained in:
parent
e540602ad9
commit
ed0e7e3fc3
15
src/build.ml
15
src/build.ml
|
@ -221,11 +221,16 @@ module Shexp = struct
|
||||||
if tail then close_out oc);
|
if tail then close_out oc);
|
||||||
return ()
|
return ()
|
||||||
| Copy_and_add_line_directive (src, dst) ->
|
| Copy_and_add_line_directive (src, dst) ->
|
||||||
let src = Path.to_string (Path.relative dir src) in
|
let src = Path.relative dir src in
|
||||||
let dst = Path.to_string (Path.relative dir dst) in
|
let dst = Path.relative dir dst in
|
||||||
with_file_in src ~f:(fun ic ->
|
with_file_in (Path.to_string src) ~f:(fun ic ->
|
||||||
with_file_out dst ~f:(fun oc ->
|
with_file_out (Path.to_string dst) ~f:(fun oc ->
|
||||||
Printf.fprintf oc "# 1 %S\n" src;
|
let fn =
|
||||||
|
match Path.extract_build_context src with
|
||||||
|
| None -> src
|
||||||
|
| Some (_, rem) -> rem
|
||||||
|
in
|
||||||
|
Printf.fprintf oc "# 1 %S\n" (Path.to_string fn);
|
||||||
copy_channels ic oc));
|
copy_channels ic oc));
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue