1 Dec 2010 01:59
Re: Conditional compilation for different versions of GHC?
Jason Dagit <dagit <at> codersbase.com>
2010-12-01 00:59:38 GMT
2010-12-01 00:59:38 GMT
On Sat, Nov 27, 2010 at 9:59 AM, Jinjing Wang <nfjinjing <at> gmail.com> wrote:
Thanks Michael,
So the user should use `cabal install --flags -ghc7 package-name` to
install the package, if I'm not mistaken?
Will it work if the package is installed as a dependency? Will the
flag environment be passed down from the root package?
Is there a way to detect GHC version automatically?
I see that others have provided answers on here, but another way is to change the check from:
if flag(ghc7)
build-depends: base >= 4.3 && < 5
cpp-options: -DGHC7
else
build-depends: base >= 4 && < 4.3
to this:
if impl(ghc >= 7)
build-depends: base >= 4.3 && < 5
cpp-options: -DGHC7
else
build-depends: base >= 4 && < 4.3
I hope that helps,
Jason
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe <at> haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RSS Feed