File tree Expand file tree Collapse file tree 2 files changed +43
-3
lines changed Expand file tree Collapse file tree 2 files changed +43
-3
lines changed Original file line number Diff line number Diff line change 1- (jbuild_version 1)
1+ (* -*- tuareg -*- *)
2+ #require "unix"
3+ let graphics_exists =
4+ try
5+ let ic = Unix.open_process_in "ocamlfind query -a-format -predicates byte graphics" in
6+ let path = input_line ic in
7+ close_in ic;
8+ Sys.file_exists path
9+ with _ -> false
10+
11+ let () =
12+ let jbuild =
13+ if graphics_exists
14+ then {|
215(library
316 ((name graphics_js)
417 (public_name js_of_ocaml-lwt.graphics)
518 (synopsis "Graphics for js_of_ocaml.")
619 (optional)
720 (libraries (js_of_ocaml js_of_ocaml-lwt lwt graphics))
821 (preprocess (pps (js_of_ocaml-ppx)))))
22+ |}
23+ else {||}
24+ in
25+ Printf.ksprintf Jbuild_plugin.V1.send {|
26+ (jbuild_version 1)
27+ %s
28+ |} jbuild
Original file line number Diff line number Diff line change 1- (jbuild_version 1)
1+ (* -*- tuareg -*- *)
2+ #require "unix"
3+ let camlp4_exists =
4+ try
5+ let ic = Unix.open_process_in "ocamlfind query -a-format -predicates byte camlp4.lib" in
6+ let path = input_line ic in
7+ close_in ic;
8+ Sys.file_exists path
9+ with _ -> false
10+
11+ let () =
12+ let jbuild =
13+ if camlp4_exists
14+ then {|
215(library
316 ((name js_of_ocaml_toplevel_camlp4)
417 (public_name js_of_ocaml-toplevel.camlp4)
5- (libraries (js_of_ocaml-toplevel camlp4))
18+ (libraries (js_of_ocaml-toplevel camlp4.lib ))
619 (optional)
720 (library_flags (-linkall))
821 (preprocess (pps (js_of_ocaml-ppx)))))
22+ |}
23+ else {||}
24+ in
25+ Printf.ksprintf Jbuild_plugin.V1.send {|
26+ (jbuild_version 1)
27+ %s
28+ |} jbuild
You can’t perform that action at this time.
0 commit comments