diff --git a/bin/dune b/bin/dune index ec316546..d5c72b2b 100644 --- a/bin/dune +++ b/bin/dune @@ -3,5 +3,5 @@ (public_name ODiffBin) (package odiff) (flags - (:standard -w -27 -cc gcc)) + (:standard -w -27)) (libraries odiff-core odiff-io cmdliner)) diff --git a/io/config/discover.ml b/io/config/discover.ml index caf3232e..e5745ef8 100644 --- a/io/config/discover.ml +++ b/io/config/discover.ml @@ -104,9 +104,10 @@ let get_flags_from_env_or_run_pkg_conifg c ~env ~lib = let c_flags_to_ocaml_opt_flags flags = flags |> List.filter_map (function - | opt when String.starts_with opt ~prefix:"-l" -> Some [ "-cclib"; opt ] - | _ -> None) - |> List.flatten + | opt when String.starts_with opt ~prefix:"-l" -> + let flag = String.sub opt 2 (String.length opt - 2) in + Some [ "-cclib"; "-l:" ^ flag ^ ".a" ] + | opt -> Some [ "-ccopt"; opt ]) |> List.flatten let () = C.main ~name:"odiff-c-lib-packae-resolver" (fun c ->