ocaml/dune

Set mode-only flags

Open

#1,481 opened on Oct 21, 2018

 (6 comments) (0 reactions) (0 assignees)OCaml (478 forks)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (1,882 stars)
PR merge metrics
 (Avg merge 1d 20h) (345 merged PRs in 30d)

Description

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!

Contributor guide