Optional dependencies
Optional dependencies are handled in the libraries stanza of dune files by providing either an empty file if the dependency does not exist or providing the proper file if it does (see https://gitlab.math.univ-paris-diderot.fr/cduce/cduce/-/blob/polymorphic/backend/native/dune for example).
Let's see what are other possibilities.