@@ -508,20 +508,22 @@ let run libs verbose packages_dir odoc_dir odocl_dir html_dir stats nb_workers
508
508
let () = Worker_pool. start_workers env sw nb_workers in
509
509
510
510
let all =
511
- if voodoo then
512
- match package_name with
513
- | Some p -> Voodoo. of_voodoo p blessed
514
- | None -> failwith " Need a package name for voodoo"
515
- else
516
- match dune_style with
517
- | Some dir -> Dune_style. of_dune_build dir
518
- | None ->
519
- let libs = if libs = [] then Ocamlfind. all () else libs in
520
- let libs =
521
- List. map Ocamlfind. sub_libraries libs
522
- |> List. fold_left Util.StringSet. union Util.StringSet. empty
523
- in
524
- Packages. of_libs packages_dir libs
511
+ match (voodoo, package_name, dune_style, packages_dir) with
512
+ | true , Some p , None , None -> Voodoo. of_voodoo p blessed
513
+ | false , None , Some dir , None -> Dune_style. of_dune_build dir
514
+ | false , None , None , packages_dir ->
515
+ let libs = if libs = [] then Ocamlfind. all () else libs in
516
+ let libs =
517
+ List. map Ocamlfind. sub_libraries libs
518
+ |> List. fold_left Util.StringSet. union Util.StringSet. empty
519
+ in
520
+ Packages. of_libs packages_dir libs
521
+ | true , None , _ , _ -> failwith " --voodoo requires --package-name"
522
+ | false , Some _ , _ , _ -> failwith " --package-name requires --voodoo"
523
+ | true , _ , _ , Some _ | false , _ , Some _ , Some _ ->
524
+ failwith " --packages-dir is only useful in opam mode"
525
+ | true , _ , Some _ , _ ->
526
+ failwith " --voodoo and --dune-style are mutually independent"
525
527
in
526
528
let partial =
527
529
if voodoo then
0 commit comments