Skip to content

Commit

Permalink
Extract most library extensions to std dune library
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Oct 4, 2023
1 parent 093eb5e commit a840e41
Show file tree
Hide file tree
Showing 17 changed files with 54 additions and 23 deletions.
19 changes: 10 additions & 9 deletions src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
(name goblint_lib)
(public_name goblint.lib)
(modules :standard \ goblint mainspec privPrecCompare apronPrecCompare messagesCompare)
(libraries goblint.sites goblint.build-info goblint-cil.all-features batteries.unthreaded qcheck-core.runner sha json-data-encoding jsonrpc cpu arg-complete fpath yaml yaml.unix uuidm goblint_timing catapult goblint_backtrace fileutils
(libraries goblint.sites goblint.build-info goblint-cil.all-features batteries.unthreaded qcheck-core.runner sha json-data-encoding jsonrpc cpu arg-complete fpath yaml yaml.unix uuidm goblint_timing catapult goblint_backtrace fileutils goblint_std
; Conditionally compile based on whether apron optional dependency is installed or not.
; Alternative dependencies seem like the only way to optionally depend on optional dependencies.
; See: https://dune.readthedocs.io/en/stable/concepts.html#alternative-dependencies.
Expand Down Expand Up @@ -56,6 +56,7 @@
(-> violationZ3.no-z3.ml)
)
)
(flags :standard -open Goblint_std)
(foreign_stubs (language c) (names stubs))
(ocamlopt_flags :standard -no-float-const-prop)
(preprocess
Expand All @@ -77,33 +78,33 @@
(public_names goblint -)
(modes byte native) ; https://dune.readthedocs.io/en/stable/dune-files.html#linking-modes
(modules goblint mainspec)
(libraries goblint.lib goblint.sites.dune goblint.build-info.dune)
(libraries goblint.lib goblint.sites.dune goblint.build-info.dune goblint_std)
(preprocess (pps ppx_deriving.std ppx_deriving_hash ppx_deriving_yojson))
(flags :standard -linkall)
(flags :standard -linkall -open Goblint_std)
)

(executable
(name privPrecCompare)
(modules privPrecCompare)
(libraries goblint.lib goblint.sites.dune goblint.build-info.dune)
(libraries goblint.lib goblint.sites.dune goblint.build-info.dune goblint_std)
(preprocess (pps ppx_deriving.std ppx_deriving_hash ppx_deriving_yojson))
(flags :standard -linkall)
(flags :standard -linkall -open Goblint_std)
)

(executable
(name apronPrecCompare)
(modules apronPrecCompare)
(libraries goblint.lib goblint.sites.dune goblint.build-info.dune)
(libraries goblint.lib goblint.sites.dune goblint.build-info.dune goblint_std)
(preprocess (pps ppx_deriving.std ppx_deriving_hash ppx_deriving_yojson))
(flags :standard -linkall)
(flags :standard -linkall -open Goblint_std)
)

(executable
(name messagesCompare)
(modules messagesCompare)
(libraries goblint.lib goblint.sites.dune goblint.build-info.dune)
(libraries goblint.lib goblint.sites.dune goblint.build-info.dune goblint_std)
(preprocess (pps ppx_deriving.std ppx_deriving_hash ppx_deriving_yojson))
(flags :standard -linkall)
(flags :standard -linkall -open Goblint_std)
)

(rule
Expand Down
17 changes: 3 additions & 14 deletions src/goblint_lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -469,29 +469,18 @@ module ConfigVersion = ConfigVersion

(** {1 Library extensions}
OCaml library extensions which are completely independent of Goblint. *)
OCaml library extensions which are completely independent of Goblint.
See {!Goblint_std}. *)

(** {2 Standard library}
OCaml standard library extensions which are not provided by {!Batteries}. *)

module GobFormat = GobFormat
module GobGc = GobGc
module GobHashtbl = GobHashtbl
module GobList = GobList
module GobRef = GobRef
module GobResult = GobResult
module GobOption = GobOption
module GobSys = GobSys
module GobUnix = GobUnix

(** {2 Other libraries}
External library extensions. *)

module GobFpath = GobFpath
module GobPretty = GobPretty
module GobYaml = GobYaml
module GobYojson = GobYojson
module GobZ = GobZ
module MyCheck = MyCheck
17 changes: 17 additions & 0 deletions src/util/std/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(include_subdirs no)

(library
(name goblint_std)
(public_name goblint.std)
(libraries
batteries
zarith
goblint-cil
fpath
yojson
yaml)
(preprocess
(pps
ppx_deriving.std
ppx_deriving_hash
ppx_deriving_yojson)))
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions src/util/std/goblint_std.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
(** OCaml library extensions which are completely independent of Goblint. *)

(** {1 Standard library}
OCaml standard library extensions which are not provided by {!Batteries}. *)

module GobGc = GobGc
module GobHashtbl = GobHashtbl
module GobList = GobList
module GobRef = GobRef
module GobResult = GobResult
module GobOption = GobOption
module GobSys = GobSys
module GobUnix = GobUnix

(** {1 Other libraries}
External library extensions. *)

module GobFpath = GobFpath
module GobPretty = GobPretty
module GobYaml = GobYaml
module GobYojson = GobYojson
module GobZ = GobZ

0 comments on commit a840e41

Please sign in to comment.