ocaml-google-app/myocamlbuild.ml
2016-12-03 13:55:44 +01:00

25 lines
678 B
OCaml

open Ocamlbuild_plugin
module MyProject = struct
flag ["js_of_ocaml";"prettyjs"](A"--pretty");
flag ["link";"byte";"ocaml";"program";"no_check_prims"](A"-no-check-prims");
rule "%.js -> %.byte"
~dep:"%.byte"
~prod:"%.js"
(
fun env build ->
let input = env "%.byte" in
let tags = tags_of_pathname input ++ "js_of_ocaml" in
Cmd(S[A"js_of_ocaml"; T tags; A"+gen_js_api/ojs_runtime.js"; A input])
)
end
let () = dispatch (
function
| Before_options ->
Options.use_ocamlfind := true;
| After_rules ->
()
| _ -> ()
)