Overriding CPP preprocessor on OSX

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Overriding CPP preprocessor on OSX

Cody Goodman
I'm having some problems[0] with the derive-storable package on OSX I don't have on Ubuntu. I would like to use g++ rather than clang to preprocess CPP code. Is there a way to do this with cabal?

Thanks!

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Overriding CPP preprocessor on OSX

Anthony Cowley

Cody Goodman writes:

> I'm having some problems[0] with the derive-storable package on OSX I don't
> have on Ubuntu. I would like to use g++ rather than clang to preprocess CPP
> code. Is there a way to do this with cabal?
>
> Thanks!
>
> 0: https://github.com/mkloczko/derive-storable/issues/1

You can go a step further and avoid depending on cpp from any of the big C compilers!

Add `hpp` to your `build-depends`, and add this to your .cabal file,

```
ghc-options: -pgmPhpp
```

Then if the preprocessor does something untoward, we can actually fix it!

Or you can use the same style of `ghc-options` flag to call gcc's cpp.

Anthony
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.