本文介绍了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 Trueor
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-O3and 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:有条件地覆盖标志默认值
发布评论