3

有没有办法重写:

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

或者

flag llvm
    description: compile via LLVM
    default    : True

if os(mingw32)
    ?SET-LLVM=False?

并开始cabal使用它?


笔记:

在同一个文件中,该llvm标志的使用如下:

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

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

4

1 回答 1

3

你可以这样做:

flag llvm
    description: compile via LLVM
    default    : True

-- ...

Executable foo
    if flag(llvm) && !os(windows)
        ghc-options: -fllvm -optlo-O3
于 2012-05-09T22:50:58.450 回答