C编译器选择在cabal包中 [英] C compiler selection in cabal package

查看:88
本文介绍了C编译器选择在cabal包中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我决定添加一些标志来控制C源文件的编译方式(即use-clang,use-intel等)。

 
C-Sources:c_lib / tiger.c
Include-Dirs:c_lib
Install-Includes:tiger.h

if flag(debug)
GHC-Options:-debug -Wall -fno-warn-orphans
CPP-Options:-DDEBUG
CC-Options:-DDEBUG -g
else
GHC-Options :-Wall -fno-warn-orphans

问题是:需要修改descritpion文件中的哪些选项才能更改C编译器?我确实找到了只有CC选项。

解决方案

真的似乎没有任何方法可以指定.cabal文件;我们目前似乎只有在这里才有用的唯一一个是 - with-< prog> =路径



我建议您尝试在 trac 上向Cabal申请一张票。

I decided to add some flags to control the way that C source file is compiled (i.e. something like use-clang, use-intel etc.).

      C-Sources:    c_lib/tiger.c
      Include-Dirs: c_lib
      Install-Includes: tiger.h

      if flag(debug)
          GHC-Options: -debug -Wall -fno-warn-orphans
          CPP-Options: -DDEBUG
          CC-Options: -DDEBUG -g
      else
          GHC-Options: -Wall -fno-warn-orphans

Question is: which options in descritpion file need to be modified to change C compiler? I did found only CC-Options.

解决方案

There really doesn't seem to be any way to specify this in a .cabal file; the only thing we seem to have at the moment that would be even remotely useful here is --with-<prog>=path.

I suggest you try filing a ticket against Cabal on the trac.

这篇关于C编译器选择在cabal包中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆