2 let src_file_re = Str.regexp
"^\\([ \t]*\\)\\(.*\\)([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 group1 = Utils.safe_group
1 s
in
31 let win_path = Utils.safe_group
2 s
in
33 Path.prerr
false win_path;
34 let gend = Utils.safe_group_end
2 in
35 process_include_err (String.sub s
gend (String.length s
- gend));
39 process_include_err s
;
43 let invoke argv arg_start
=
44 let tool = Utils.tool_name
"cl" in
45 let args = Utils.make_arg_string
Path.check_and_modify_absolute argv arg_start
in
46 if Utils.contains_question argv arg_start
48 let command = Utils.construct_args
tool args "" in
49 let ic = Unix.open_process_in
command in
50 Utils.iter_crlf_chan
ic print_endline
;
51 let code = Utils.close_process_in
ic in
54 let command = Utils.construct_args
tool args "-nologo" in
55 let ic = Unix.open_process_in
command in
56 Utils.iter_crlf_chan
ic process_cl_output_line;
57 let code = Utils.close_process_in
ic in