In my current project I have a file Tokens.x
that needs to be compiled to Tokens.hs
by Alex. In my .cabal
file I have listed Tokens
in the other-modules
section and cabal build
happily creates the file.
However it does so without the -g option that instructs Alex to create a GHC optimized version of the file. This option represents a 10x speed up in scanning when used with GHC and is also an order of magnitude faster to compile.
How do I tell cabal to included the -g option when compiling using GHC?
-a -g -c
to all Happy invocations as recommended by the Happy manual. – Reinareinald