(include_subdirs unqualified)

(test
  (name mainTest)
  (libraries ounit2 qcheck-ounit goblint.std goblint.common goblint.lib goblint.constraint goblint.solver goblint.cdomain.value
    ; Conditionally compile based on whether apron optional dependency is installed or not.
    ; See: https://dune.readthedocs.io/en/stable/reference/library-dependencies.html#alternative-dependencies
    (select sparseMatrixImplementationTest.ml from
        (apron -> sparseMatrixImplementationTest.apron.ml)
        (-> sparseMatrixImplementationTest.no-apron.ml)
    )
  )
  (preprocess (pps ppx_deriving.std ppx_deriving_hash ppx_deriving_yojson))
  (flags :standard -open Goblint_std -linkall))

(env
  (dev
    (flags (:standard -warn-error -A -w -unused-var-strict)) ; https://dune.readthedocs.io/en/stable/faq.html#how-to-make-warnings-non-fatal
  )
)

; Workaround for alternative dependencies with unqualified subdirs.
; See: https://github.com/ocaml/dune/issues/4383#issuecomment-805107435.
; TODO: Remove workaround with dune 3.0, where this should get fixed.
; A dune file with "include_subdirs no" is located in cdomains/affineEqualityDomain to avoid a dependency cycle
(copy_files# cdomains/affineEqualityDomain/sparseImplementation/*.ml)