Use the correct ppx driver for the compat ppx.exe in jbuild mode

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
This commit is contained in:
Jeremie Dimino 2018-07-10 13:28:19 +01:00 committed by Jérémie Dimino
parent 1d594ce5a3
commit f748a33aae
1 changed files with 9 additions and 7 deletions

View File

@ -196,16 +196,18 @@ module Gen(P : Install_params) = struct
let deps = let deps =
List.concat_map lib.buildable.libraries ~f:Lib_dep.to_lib_names List.concat_map lib.buildable.libraries ~f:Lib_dep.to_lib_names
in in
if List.exists deps ~f:(function match
| "ppx_driver" | "ppxlib" | "ppx_type_conv" -> true List.filter deps ~f:(function
| _ -> false) then | "ppx_driver" | "ppxlib" | "ppx_type_conv" -> true
match Scope.name scope with | _ -> false)
| Named "ppxlib" -> with
| [] -> None
| l ->
match Scope.name scope, List.mem ~set:l "ppxlib" with
| Named "ppxlib", _ | _, true ->
Some "ppxlib.runner" Some "ppxlib.runner"
| _ -> | _ ->
Some "ppx_driver.runner" Some "ppx_driver.runner"
else
None
in in
[Preprocessing.get_compat_ppx_exe sctx ~name ~kind:(Jbuild driver)] [Preprocessing.get_compat_ppx_exe sctx ~name ~kind:(Jbuild driver)]
in in