Cabal:有条件地覆盖标志默认值

编程入门 行业动态 更新时间:2024-10-24 00:24:28
本文介绍了Cabal:有条件地覆盖标志默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

标志llvm 描述:通过LLVM编译默认值:if os(mingw32) False else True

标志llvm 描述:通过LLVM编译默认值:True if os(mingw32)?SET-LLVM = False?

并获得 cabal 以使用它?

注意: 进一步在同一文件中使用 llvm 标志,如:

if flag(llvm) ghc-options:-fllvm -optlo-O3

和那里还有许多其他单个高级标志可以转换为多个 ghc-options 条目,例如 static 到 -static -optl-static 。

解决方案

/ p>

标志llvm 描述:通过LLVM编译默认值:True - - ... 可执行foo if flag(llvm)&& !os(windows) ghc-options:-fllvm -optlo-O3

Is there any way to rewrite either:

flag llvm description: compile via LLVM default : if os(mingw32) False else True

or

flag llvm description: compile via LLVM default : True if os(mingw32) ?SET-LLVM=False?

and get cabal to work with it?

Note:

Further down in the same file the llvm flag is used like:

if flag(llvm) ghc-options: -fllvm -optlo-O3

and there are many other single high-level flags that translate to multiple ghc-options entries, such as static to -static -optl-static.

解决方案

You can do something like this:

flag llvm description: compile via LLVM default : True -- ... Executable foo if flag(llvm) && !os(windows) ghc-options: -fllvm -optlo-O3

更多推荐

Cabal:有条件地覆盖标志默认值

本文发布于:2023-10-24 08:43:32,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有条件   默认值   标志   Cabal

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!