Skip to content

Commit

Permalink
Restore support for OCaml 4.02
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Leonard committed Jun 12, 2017
1 parent 29e6739 commit 65564f3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/benchmark/fastRand/jbuild
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
(c_names (fast_rand))
(c_flags (:standard -O3))
(flags (:standard -w -3))
(ocamlopt_flags (:standard -O3))
))
18 changes: 17 additions & 1 deletion src/benchmark/jbuild
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
(* -*- tuareg -*- *)

let config = {|

(jbuild_version 1)

(executable
((name main)
(libraries (capnp fast_rand core))
(flags (:standard -w -27-53-55-3-35))
(ocamlopt_flags (:standard -O3 -inline 2000))
(ocamlopt_flags (:standard # -inline 2000))
))

(rule
Expand Down Expand Up @@ -41,3 +45,15 @@
((name benchmarks)
(deps (carsales catrank eval))
))

|}

let () =
let hash = String.index config '#' in
let opt = if Jbuild_plugin.V1.ocaml_version >= "4.03" then "-O3" else "" in
let config =
String.sub config 0 hash ^
opt ^
String.sub config (hash + 1) (String.length config - hash - 1)
in
Jbuild_plugin.V1.send config
18 changes: 17 additions & 1 deletion src/runtime/jbuild
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
(* -*- tuareg -*- *)

let config = {|

(jbuild_version 1)

(library (
Expand All @@ -6,5 +10,17 @@
(synopsis "Runtime support library for capnp-ocaml")
(libraries (core_kernel uint ocplib-endian res extunix))
(flags (:standard -w -50-27-6-34-32-53-33))
(ocamlopt_flags (:standard -O3 -inline 1000))
(ocamlopt_flags (:standard # -inline 1000))
))

|}

let () =
let hash = String.index config '#' in
let opt = if Jbuild_plugin.V1.ocaml_version >= "4.03" then "-O3" else "" in
let config =
String.sub config 0 hash ^
opt ^
String.sub config (hash + 1) (String.length config - hash - 1)
in
Jbuild_plugin.V1.send config

0 comments on commit 65564f3

Please sign in to comment.