Merge pull request #343 from rgrinberg/fix-ppx-recompile

Fix incremental compilation with ppx's
This commit is contained in:
Rudi Grinberg 2017-12-02 21:27:04 +08:00 committed by GitHub
commit a0c2ed942b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -791,7 +791,14 @@ module PP = struct
add_rule sctx
(libs
>>>
Build.dyn_paths (Build.arr (Lib.archive_files ~mode ~ext_lib:ctx.ext_lib))
Build.dyn_paths (Build.arr (fun libs ->
List.rev_append
(Lib.archive_files ~mode ~ext_lib:ctx.ext_lib libs)
(List.filter_map libs ~f:(function
| Lib.Internal (dir, lib) ->
Some (Path.relative dir (lib.name ^ ctx.ext_lib))
| External _ ->
None))))
>>>
Build.run ~context:ctx (Ok compiler)
[ A "-o" ; Target target