(library
  (name eliom_server)
  (public_name eliom.server)
  (synopsis "Eliom: server-side")
  (wrapped false)
  (modules_without_implementation eliom_content_sigs eliom_form_sigs
   eliom_parameter_sigs eliom_registration_sigs eliom_service_sigs
   eliom_shared_sigs)
  (preprocess (pps lwt_ppx js_of_ocaml-ppx_deriving_json))
  (flags (:standard (:include type_includes)))
  (library_flags (:standard -linkall))
  (libraries lwt_react ocsigenserver ocsipersist tyxml))

(include dune.server)

(rule
  (target dune.server)
  (mode promote)
  (deps (glob_files ../*) (universe))
  (action
    (with-stdout-to
      %{target}
      (run ../../tools/gen_dune.exe --server ..))))

; We need to refer to types defined by Js_of_ocaml without a link
; dependency to some code that only makes sense in a browser.
(rule (target type_includes)
  (deps (universe))
  (action
    (with-stdout-to %{target}
      (system "printf '('; ocamlfind query -i-format js_of_ocaml; printf ')'"))))
