Disable warning 50 for configurator on 4.02.3

This commit is contained in:
Rudi Grinberg 2018-04-05 23:35:22 +08:00
parent 126c91fcd5
commit 9f9a770b13
3 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,6 @@
(jbuild_version 1)
(executable
((name mk)))
(rule (with-stdout-to flags.sexp (run ./mk.exe -ocamlv ${ocaml_version})))

View File

@ -0,0 +1,25 @@
open Printf
let parse_version s =
Scanf.sscanf s "%d.%d.%d" (fun a b c -> a, b, c)
let () =
let usage =
sprintf "%s -ocamlv version" (Filename.basename Sys.executable_name) in
let ocaml_version = ref "" in
let anon _ =
raise (Arg.Bad "anonymous arguments aren't accepted") in
Arg.parse
[ "-ocamlv"
, Arg.String (fun s -> ocaml_version := s)
, "Version of ocaml being used"
] anon usage;
if !ocaml_version = "" then
raise (Arg.Bad "Provide version with -ocamlv")
else
let (x, y, _) = parse_version !ocaml_version in
if x >= 4 && y > 2 then (
printf "()\n"
) else (
printf "(-w -50)\n"
)

View File

@ -1,7 +1,7 @@
(library
((name configurator)
(flags (:standard -safe-string))
(libraries (stdune ocaml_config))
(flags (:standard -safe-string (:include flags/flags.sexp)))
(preprocess no_preprocessing)))
(jbuild_version 1)