Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions myocamlbuild.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
open Ocamlbuild_plugin

let () = dispatch Ocb_stubblr.(
init & ccopt ~tags:["accelerate"] "-DACCELERATE -mssse3 -maes -mpclmul"
)
let runtime_deps_of_ppx ppx =
(Findlib.query "ppx_sexp_conv").dependencies
|> List.filter_opt (fun { Findlib.name; _ } ->
if name = ppx || name = "ppx_deriving" then
None
else
Some name)

let () = dispatch (fun hook ->
Ocb_stubblr.(
init & ccopt ~tags:["accelerate"] "-DACCELERATE -mssse3 -maes -mpclmul"
) hook;
match hook with
| After_rules ->
let meta = "pkg/META" in
let meta_in = meta ^ ".in" in
rule meta ~dep:meta_in ~prod:meta (fun _ _ ->
let deps = String.concat " " (runtime_deps_of_ppx "ppx_sexp_conv") in
Echo([String.subst "PPX_SEXP_CONV_RUNTIME" deps
(Pathname.read meta_in)],
meta))
| _ -> ())
2 changes: 1 addition & 1 deletion pkg/META → pkg/META.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version = "%%VERSION_NUM%%"
description = "Simple crypto for the modern age"
requires = "cstruct zarith sexplib"
requires = "cstruct zarith sexplib PPX_SEXP_CONV_RUNTIME"
archive(byte) = "nocrypto.cma"
archive(native) = "nocrypto.cmxa"
plugin(byte) = "nocrypto.cma"
Expand Down