How to use -thread compiler flag with ocamlbuild?

做~自己de王妃 提交于 2019-12-03 09:53:03

What you want to know is whether there is an ocamlbuild tag (~ feature) to add the -thread argument to the relevant command-lines, instead of hacking it with -cflag in unsatisfying ways. As explained in this blog post, you should use the -documentation option of ocamlbuild:

% ocamlbuild -documentation | grep thread
flag {. byte, link, ocaml, program, thread .} "threads.cma -thread"
flag {. link, native, ocaml, program, thread .} "threads.cmxa -thread"
flag {. doc, ocaml, thread .} "-I +threads"
flag {. compile, ocaml, thread .} "-thread"

So the answer is: add -tag thread to your ocamlbuild invocation line, or just thread in the relevant place in _tags.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!