Closed simonmichael closed 8 years ago
Yeah, this is a known issue. Those marcros are provided by Cabal, so the preprocessor does not recognize them. I have yet to find a way to make it work. We were discussing some solutions here: #14
This is the function we need: http://haddock.stackage.org/lts-3.10/Cabal-1.22.4.0/Distribution-Simple-BuildPaths.html#v:autogenModulesDir
It gives the path to the autogenerated modules directory, which contains, among other things, the cabal_macros.h
file that we need. The problem now is how to get the LocalBuildInfo
object.
I confirmed that this bug is fixed with when using the new option --cabal-macros
. If you are using Stack, it's as easy as:
$ argon --cabal-macros $(stack path --dist-dir)/build/autogen/cabal_macros.h src
If instead you are using pure Cabal I don't know the exact path. That header file is generated during cabal build
, so one has to be sure to have it up-to-date when passing it to Argon.
The change has already been pushed to master, and will be included in the upcoming 0.4.0.0 version.
gives:
(context)