From 709a49fcabb8a1088ef70456c81b553167ebc8e7 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Fri, 10 Jun 2022 11:33:31 +0100 Subject: [PATCH] Only install modules for 4.14+ Use the Standard Library modules for OCaml 4.x, but override 4.14's to eliminate the deprecation warning. --- CHANGES.md | 3 ++- src/dune | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 4cba8f2..230a2dc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,8 @@ - Update licensing metadata. - Update dune files to 2.7 to autogenerate opam files correctly (#2) -- Lower OCaml version to 4.02.3 +- Lower OCaml version to 4.02.3 (#3) +- Install empty library for OCaml < 4.14 (#5) # Release 5.0 (2021-06-29) diff --git a/src/dune b/src/dune index 1a23450..e666e35 100644 --- a/src/dune +++ b/src/dune @@ -1,5 +1,15 @@ +(* -*- tuareg -*- *) + +open Jbuild_plugin.V1 + +let modules = + let version = Scanf.sscanf ocaml_version "%u.%u" (fun a b -> (a, b)) in + if version >= (4, 14) then ":standard" else "" + +let () = Printf.ksprintf send {| (library (name camlp_streams) (public_name camlp-streams) + (modules %s) (wrapped false) - (flags :standard -w -9)) + (flags :standard -w -9))|} modules