Commit abf1090a authored by Rodolphe Lepigre's avatar Rodolphe Lepigre
Browse files

Fix tooling bug preventing C files in project root.

parent 8e4f1e55
Pipeline #50492 passed with stage
in 16 minutes and 42 seconds
......@@ -95,6 +95,7 @@ module Filename =
let relative_path : string -> string -> string = fun root file ->
let root = realpath root in
let file = realpath file in
if root = file then "." else
let root_len = String.length root in
let full_len = String.length file in
if root_len > full_len then
......
......@@ -161,7 +161,10 @@ let run : config -> string -> unit = fun cfg c_file ->
(* Add the mapping to the Coq project file for editors. *)
let dune_dir_path =
let relative_path = Filename.relative_path root_dir c_file_dir in
let path = Filename.concat "_build/default" relative_path in
let path =
if relative_path = Filename.current_dir_name then "_build/default"
else Filename.concat "_build/default" relative_path
in
let path = Filename.concat path rc_dir_name in
Filename.concat path c_file_name_no_ext
in
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment