ocaml/dune

Set mode-only flags

开放

#1,481 创建于 2018年10月21日

 (6 条评论) (0 个反应) (0 位负责人)OCaml (478 个派生)github user discovery
enhancementhelp wanted

仓库指标

星标
 (1,882 个星标)
PR 合并指标
 (平均合并 1天 20小时) (30 天内合并 345 个 PR)

描述

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!

贡献者指南