We need the .a to build the .cmxs

Should fix janestreet/re2#17
This commit is contained in:
Jeremie Dimino 2016-12-19 11:47:17 +00:00
parent 079d64f48c
commit ea888074b0
1 changed files with 19 additions and 9 deletions

View File

@ -996,15 +996,25 @@ module Gen(P : Params) = struct
Option.iter ctx.ocamlopt ~f:(fun ocamlopt ->
let src = lib_archive lib ~dir ~ext:(Mode.compiled_lib_ext Native) in
let dst = lib_archive lib ~dir ~ext:".cmxs" in
add_rule
(Build.run
(Dep ocamlopt)
[ Ocaml_flags.get flags Native
; A "-shared"; A "-linkall"
; A "-I"; Path dir
; A "-o"; Target dst
; Dep src
])
let build =
Build.run
(Dep ocamlopt)
[ Ocaml_flags.get flags Native
; A "-shared"; A "-linkall"
; A "-I"; Path dir
; A "-o"; Target dst
; Dep src
]
in
let build =
if Library.has_stubs lib then
Build.path (stubs_archive ~dir lib)
>>>
build
else
build
in
add_rule build
);
match lib.kind with