I have a dune-based build. I want to do optional compilation based on the value of an environment variable. I would like to use ppx_optcomp. However, I can’t see how to make compilation depend on an env var.
There is ppx_getenv https://github.com/ocaml-ppx/ppx_getenv, but this doesn’t seem to work with dune.
Does anyone have any suggestions?
The particular use case is that I want to enable/disable profiling based on an env var, and it is important to me that I can disable at compile time in order that profiling does not affect non-profiled performance.