Am 28.02.2014 23:00, schrieb Roman Cheplyaka:

* Henning Thielemann <lemm...@henning-thielemann.de> [2014-02-28 22:48:59+0100]

Nice! Is there a recommended way to transfer CPP options from the
Cabal file to the CpphsOptions record?

Yes, haskell-packages[2] lets you easily create a cabal-integrated
"compiler". See the compile method[3] in particular.

For an example of how this all glues together, see [4].

[2]: http://hackage.haskell.org/package/haskell-packages
[3]: 
http://hackage.haskell.org/package/haskell-packages-0.2.3.4/docs/Distribution-HaskellSuite-Compiler.html#v:compile
[4]: 
https://github.com/haskell-suite/haskell-names/blob/master/hs-gen-iface/src/hs-gen-iface.hs#L70

Treating check-pvp as compiler driven by Cabal sounds reasonable, since this would do all the preprocessing stuff and would also work on tarballs etc. However the haskell-name framework seems to expect a binary executable as compiler. According to

   http://documentup.com/haskell-suite/haskell-names

I would have to design the checker as a tool that only reads modules, not the package description, called maybe 'check-modules-pvp' and then run

$ cabal install --haskell-suite -w check-modules-pvp mypkg

My problem is: The checker needs to read the package description in order to classify the dependency ranges. The compiler has no access to the package description. If it tries to load the package description manually, that will fail on tarballs.

I can also not see how I define my own command line options in the Compiler interface.

_______________________________________________
cabal-devel mailing list
cabal-devel@haskell.org
http://www.haskell.org/mailman/listinfo/cabal-devel

Reply via email to