From f748a33aaead722580810a184d0653132d207cde Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Tue, 10 Jul 2018 13:28:19 +0100 Subject: [PATCH] Use the correct ppx driver for the compat ppx.exe in jbuild mode Signed-off-by: Jeremie Dimino --- src/install_rules.ml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/install_rules.ml b/src/install_rules.ml index 1df2d525..e0625ec6 100644 --- a/src/install_rules.ml +++ b/src/install_rules.ml @@ -196,16 +196,18 @@ module Gen(P : Install_params) = struct let deps = List.concat_map lib.buildable.libraries ~f:Lib_dep.to_lib_names in - if List.exists deps ~f:(function - | "ppx_driver" | "ppxlib" | "ppx_type_conv" -> true - | _ -> false) then - match Scope.name scope with - | Named "ppxlib" -> + match + List.filter deps ~f:(function + | "ppx_driver" | "ppxlib" | "ppx_type_conv" -> true + | _ -> false) + with + | [] -> None + | l -> + match Scope.name scope, List.mem ~set:l "ppxlib" with + | Named "ppxlib", _ | _, true -> Some "ppxlib.runner" | _ -> Some "ppx_driver.runner" - else - None in [Preprocessing.get_compat_ppx_exe sctx ~name ~kind:(Jbuild driver)] in