; Rule to build a js version runnable with node-js of Alt-Ergo
(executable
 (name main_text_js)
 (public_name alt-ergo-js)
 (package alt-ergo-js)
 (libraries
   alt_ergo_common
   zarith_stubs_js
 )
 (modules main_text_js)
 (modes byte js)
 (js_of_ocaml (flags --no-source-map +toplevel.js +dynlink.js))
)

(library
 (name worker_interface)
 (package alt-ergo-js)
 (libraries
   js_of_ocaml
   data-encoding
 )
 (modules worker_interface)
)

; Rule to build a web worker running Alt-Ergo
(executable
 (name worker_js)
 (libraries
   worker_interface
   alt_ergo_common
   zarith_stubs_js
   js_of_ocaml
   js_of_ocaml-lwt
 )
 (modules worker_js options_interface)
 (modes byte js)
 (js_of_ocaml (flags --no-source-map +toplevel.js +dynlink.js))
)

; Rule to build a small js example running the Alt-Ergo web worker
(executable
 (name worker_example)
 (libraries
   worker_interface
   zarith_stubs_js
   js_of_ocaml
   js_of_ocaml-lwt
 )
 (modules worker_example)
 (modes byte js)
 (preprocess (pps js_of_ocaml-ppx lwt_ppx))
)
