I can specify the ghc options to stack using the ghc-options field in the .cabal file.
Cabal file warning in C:\Example.cabal: Unknown fields: happy-options (line 27)
Fields allowed in this section:
exposed-modules, reexported-modules, required-signatures,
exposed-signatures, exposed, buildable, build-tools, build-depends,
cpp-options, cc-options, ld-options, pkgconfig-depends, frameworks,
c-sources, js-sources, default-language, other-languages,
default-extensions, other-extensions, extensions, extra-libraries,
extra-ghci-libraries, extra-lib-dirs, includes, install-includes,
include-dirs, hs-source-dirs, other-modules, ghc-prof-options,
ghcjs-prof-options, ghc-shared-options, ghcjs-shared-options,
ghc-options, ghcjs-options, jhc-options, hugs-options,
nhc98-options