Reputation: 191
In my project's .cabal file I have a flag to control where to use https. However http-client doesn't build well with much older ghc versions... Is there a way to change the default for the flag for older ghc?
I can't see one or any other workaround (other than ignoring the flag).
Upvotes: 3
Views: 99
Reputation: 152707
I haven't tested, but I would guess something like this works.
flag foo
if impl(ghc > 7.10)
default: True
else
default: False
Even if not, you can at least make the error appear early by making each stanza unbuildable in bad configurations, e.g.
executable foo
if (impl(ghc > 7.10) && !foo) || (impl(ghc <= 7.10) && foo)
buildable: False
Upvotes: 1