tweag / asterius

DEPRECATED in favor of ghc wasm backend, see https://www.tweag.io/blog/2022-11-22-wasm-backend-merged-in-ghc
1.98k stars 55 forks source link

support the cabal condition "impl(ahc-ghc)" #900

Open gelisam opened 2 years ago

gelisam commented 2 years ago

Is your feature request related to a problem? Please describe. I want the same code to compile with both ahc-ghc and ghc, but some libraries (e.g. sdl2) are not compatible with ahc-ghc.

Describe the solution you'd like I wish ahc-cabal would recognize the condition impl(ahc-ghc). Currently, it recognizes impl(ghc), so I cannot use this condition to distinguish ahc-ghc from ghc.

Describe alternatives you've considered I have defined a configuration flag instead:

flag asterius
  description: Whether we're compiling with ahc-ghc (true) or ghc (false).
  default: false
  manual: true

It works fine, I just have to remember to pass --flags="asterius" when compiling with ahc-cabal and to not pass it when compiling with cabal. Since the cabal package description format provides an easy way to detect the compiler automatically, it just seems unfortunate that I have to specify it manually :)