Don't pass specific arguments when not using ppx_driver.runner

Fix #37
This commit is contained in:
Jeremie Dimino 2017-03-27 14:30:40 +01:00
parent 8e64aa0990
commit c48e90e357
1 changed files with 15 additions and 12 deletions

View File

@ -766,18 +766,21 @@ module Gen(P : Params) = struct
Build.vpath file Build.vpath file
let specific_args_for_ppx_rewriters t ~dir ~lib_name ~for_merlin = let specific_args_for_ppx_rewriters t ~dir ~lib_name ~for_merlin =
Arg_spec.S if t.uses_ppx_driver then
[ S (if t.uses_here Arg_spec.S
then [A "-dirname"; Path dir] [ S (if t.uses_here
else []) then [A "-dirname"; Path dir]
; S (match lib_name with else [])
| Some name when t.uses_libname -> ; S (match lib_name with
[ A "-inline-test-lib"; A name ] | Some name when t.uses_libname ->
| _ -> []) [ A "-inline-test-lib"; A name ]
; S (if t.uses_ppx_driver && not for_merlin | _ -> [])
then [ A "-embed-errors"; A "false" ] ; S (if not for_merlin
else []) then [ A "-embed-errors"; A "false" ]
] else [])
]
else
Arg_spec.S []
end end
let ppx_drivers = Hashtbl.create 32 let ppx_drivers = Hashtbl.create 32