2 let src_file_re = Str.regexp
"^\\(.*\\)([0-9]+) :"
3 let inc_file_re = Str.regexp
"Cannot open include file: '\\(.*\\)'"
5 let process_include_err s
=
9 Some
(Str.search_forward
inc_file_re s pos
)
15 let b, e
= Utils.safe_group_extents
1 in
16 let win_path = String.sub s
b (e
- b) in
17 prerr_string
(String.sub s pos
b);
18 Path.prerr
true win_path;
19 prerr_string
(String.sub s e
(String.length s
- e
));
22 prerr_string
(String.sub s pos
(String.length s
- pos
))
26 let process_cl_output_line s
=
27 (* prerr_endline s; *)
28 if Str.string_match
src_file_re s
0
30 let win_path = Utils.safe_group
1 s
in
31 Path.prerr
false win_path;
32 let gend = Utils.safe_group_end
1 in
33 process_include_err (String.sub s
gend (String.length s
- gend));
37 process_include_err s
;
41 let invoke argv arg_start
=
42 let tool = Utils.tool_name
"cl" in
43 let args = Utils.make_arg_string
Path.check_and_modify_absolute argv arg_start
in
44 let command = Wine.command tool ^
" /nologo " ^
args in
45 let ic = Unix.open_process_in
command in
46 Utils.iter_crlf_chan
ic process_cl_output_line;
47 let code = Utils.close_process_in
ic in