Search code examples
haskellcabal

C compiler selection in cabal package


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.


Solution

  • 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.