File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -61,11 +61,14 @@ let load_and_preprocess ~all_cppflags filename =
6161 (* TODO: extract o_file *)
6262 let command = reroot command in
6363 let preprocess_command = Str. replace_first command_program_regexp (" \\ 1 " ^ String. join " " (List. map Filename. quote all_cppflags) ^ " -E -MMD -MT " ^ file) command in
64- let preprocess_command = Str. replace_first command_o_regexp (" -o " ^ preprocessed_file) preprocess_command in
6564 if preprocess_command = command then (* easier way to check if match was found (and replaced) *)
66- failwith " CompilationDatabase.preprocess: no -o argument found for " ^ file
65+ failwith " CompilationDatabase.preprocess: no program found for " ^ file
6766 else
68- preprocess_command
67+ let preprocess_command_o = Str. replace_first command_o_regexp (" -o " ^ preprocessed_file) preprocess_command in
68+ if preprocess_command_o = preprocess_command then (* easier way to check if match was found (and replaced) *)
69+ preprocess_command ^ " -o " ^ preprocessed_file
70+ else
71+ preprocess_command_o
6972 | None , Some arguments ->
7073 let arguments = List. map reroot arguments in
7174 let preprocess_arguments =
You can’t perform that action at this time.
0 commit comments