You can access the oasis environment from
myocamlbuild.ml and setup compilation flags according to it. See for instance:
So you could have this in your _oasis:
Flag use_b
Default: false
----------------------------------
(* OASIS_START *)
(* OASIS_STOP *)
let dispatch = function
| After_rules ->
let env = BaseEnvLight.load () in
let module_name = if BaseEnvLight.var_get "use_b" = "true" then "B" else "A" in
flag ["ocaml"; "compile"] (S ["-open"; module_name])
| _ ->
()
let () = Ocamlbuild_plugin.dispatch (fun hook -> dispatch hook; dispatch_default hook)
----------------------------------