Merge pull request #1193 from rgrinberg/virtual-disable-archives
Disable archives for virtual libraries
This commit is contained in:
commit
6657247897
|
@ -241,7 +241,7 @@ module Gen (P : Install_rules.Params) = struct
|
|||
ocamlmklib ~sandbox:true ~custom:false ~targets:[dynamic]
|
||||
end
|
||||
|
||||
let build_stubs lib ~dir ~scope ~requires ~dir_contents =
|
||||
let build_o_files lib ~dir ~scope ~requires ~dir_contents =
|
||||
let all_dirs = Dir_contents.dirs dir_contents in
|
||||
let h_files =
|
||||
List.fold_left all_dirs ~init:[] ~f:(fun acc dc ->
|
||||
|
@ -265,7 +265,6 @@ module Gen (P : Install_rules.Params) = struct
|
|||
;
|
||||
(p, Path.relative dir (fn ^ ctx.ext_obj))
|
||||
in
|
||||
let o_files =
|
||||
let includes =
|
||||
Arg_spec.S
|
||||
[ Hidden_deps h_files
|
||||
|
@ -280,10 +279,18 @@ module Gen (P : Install_rules.Params) = struct
|
|||
) @ List.map lib.cxx_names ~f:(fun name ->
|
||||
build_cxx_file lib ~scope ~dir ~includes (resolve_name name ~ext:".cpp")
|
||||
)
|
||||
|
||||
let build_stubs lib ~dir ~scope ~requires ~dir_contents =
|
||||
let vlib_stubs_o_files = [] in (* TODO *)
|
||||
let lib_o_files =
|
||||
if Library.has_stubs lib then
|
||||
build_o_files lib ~dir ~scope ~requires ~dir_contents
|
||||
else
|
||||
[]
|
||||
in
|
||||
match lib.self_build_stubs_archive with
|
||||
| Some _ -> ()
|
||||
| None -> build_self_stubs lib ~dir ~scope ~o_files
|
||||
match vlib_stubs_o_files @ lib_o_files with
|
||||
| [] -> ()
|
||||
| o_files -> build_self_stubs lib ~dir ~scope ~o_files
|
||||
|
||||
let build_shared lib ~dir ~flags ~(ctx : Context.t) =
|
||||
Option.iter ctx.ocamlopt ~f:(fun ocamlopt ->
|
||||
|
@ -406,6 +413,7 @@ module Gen (P : Install_rules.Params) = struct
|
|||
Path.relative dir (header ^ ".h"))
|
||||
|> Path.Set.of_list);
|
||||
|
||||
if not (Library.is_virtual lib) then begin
|
||||
(let modules =
|
||||
Module.Name.Map.fold modules ~init:[] ~f:(fun m acc ->
|
||||
if Module.has_impl m then
|
||||
|
@ -433,6 +441,7 @@ module Gen (P : Install_rules.Params) = struct
|
|||
|
||||
if Dynlink_supported.By_the_os.get ctx.natdynlink_supported then
|
||||
build_shared lib ~dir ~flags ~ctx;
|
||||
end;
|
||||
|
||||
Odoc.setup_library_odoc_rules lib ~requires ~modules ~dep_graphs ~scope;
|
||||
|
||||
|
|
Loading…
Reference in New Issue