3 let line_re = Str.regexp
"^#line [0-9]+ \"\\(.*\\)\"$"
4 let over_re = Str.regexp
5 "^cl : Command line warning D4025 : overriding '/W[^']+' with '/w'"
7 let process_cl_cpp_output_line s set
=
8 if Str.string_match
line_re s
0
10 let win_path = Utils.safe_group
1 s
in
11 if debug && (not
(Utils.StringSet.mem
win_path set
))
15 Utils.StringSet.add
win_path set
19 let invoke target argv arg_start
=
20 let rejrel = Utils.build_reject_list
() in
21 let args = Utils.make_arg_string
Path.check_and_modify_absolute argv arg_start
in
22 let tool = Utils.tool_name
"cl" in
23 let command = Wine.command tool ^
"/E /nologo " ^
args ^
" /w" in
24 let env = Unix.environment
() in
25 let (ic
, _
, ec
) as channels
= Unix.open_process_full
command env in
27 Utils.fold_crlf_chan ic
process_cl_cpp_output_line Utils.StringSet.empty
in
28 Utils.iter_crlf_chan ec
31 if not
(Str.string_match
over_re s
0)
35 let code = Utils.close_process_full channels
in
44 let unix_path = Path.find2
win_path in
47 prerr_string
"Cannot convert windows path: '";
48 prerr_string
(String.escaped
win_path);
49 prerr_endline
"' to unix"
51 if not
(Utils.reject_path
unix_path rejrel)
54 print_string
unix_path;