Skip to content
Merged
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
4 changes: 2 additions & 2 deletions compiler/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
(public_name js_of_ocaml-compiler)
(synopsis "Js_of_ocaml compiler library")
(libraries
compiler-libs.common
compiler-libs.bytecomp
ocaml-compiler-libs.common
ocaml-compiler-libs.bytecomp
menhirLib
sedlex
yojson)
Expand Down
22 changes: 7 additions & 15 deletions compiler/lib/magic_number.ml
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,14 @@ let compare (p1, n1) (p2, n2) =

let equal a b = compare a b = 0

let v =
let () =
let current = Ocaml_version.current in
match current with
| 4 :: 13 :: _ -> 30
| 4 :: 14 :: _ -> 31
| 5 :: 00 :: _ -> 32
| 5 :: 01 :: _ -> 33
| 5 :: 02 :: _ -> 34
| 5 :: 03 :: _ -> 35
| 5 :: 04 :: _ -> 36
| _ ->
if Ocaml_version.compare current [ 4; 13 ] < 0
then failwith "OCaml version unsupported. Upgrade to OCaml 4.13 or newer."
else (
assert (Ocaml_version.compare current [ 5; 5 ] >= 0);
failwith "OCaml version unsupported. Upgrade js_of_ocaml.")
if Ocaml_version.compare current [ 4; 13 ] < 0
then failwith "OCaml version unsupported. Upgrade to OCaml 4.13 or newer."
else if Ocaml_version.compare current [ 5; 5 ] >= 0
then failwith "OCaml version unsupported. Upgrade js_of_ocaml."

let v = snd (of_string Ocaml_common.Config.exec_magic_number)

let current_exe = "Caml1999X", v

Expand Down
1 change: 1 addition & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
(num :with-test)
(ppx_expect (and (>= v0.16.1) :with-test))
(ppxlib (>= 0.35))
(ocaml-compiler-libs (>= v0.12.4))
(re :with-test)
(cmdliner (>= 1.1.0))
(sedlex (>= 3.3))
Expand Down
1 change: 1 addition & 0 deletions js_of_ocaml-compiler.opam
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ depends: [
"num" {with-test}
"ppx_expect" {>= "v0.16.1" & with-test}
"ppxlib" {>= "0.35"}
"ocaml-compiler-libs" {>= "v0.12.4"}
"re" {with-test}
"cmdliner" {>= "1.1.0"}
"sedlex" {>= "3.3"}
Expand Down