ocaml/dune

Set mode-only flags

Aperta

#1481 aperta il 21 ott 2018

 (6 commenti) (0 reazioni) (0 assegnatari)OCaml (478 fork)github user discovery
enhancementhelp wanted

Metriche repository

Star
 (1882 stelle)
Metriche merge PR
 (Merge medio 1g 20h) (345 PR mergiate in 30 g)

Descrizione

Is it possible to pass custom flags for specific modes? For example, dune file below works for dune build main.exe but fails for dune build main.exe.o because ocamlopt does not expect -lfoo. Is there a way to set -lfoo only for exe mode and not for object mode?

Problematic example:

(executable
   (name main)
   (libraries base core ctypes ctypes.foreign ctypes.stubs)
   (link_flags (-cclib -lfoo))
   (modes object exe))

Thanks!

Guida contributor