Now that we don't include any header files in .hc apart from our own,
the cc-options from packages are at best superfluous, so don't pass
them.
We still pass them to .c compilations, although I've just made changes
to Cabal so that cc-options from a .cabal file are not copied into the
InstalledPackageInfo. Most uses of cc-options in Cabal are clearly
intended to be local to the package, but they were being propagated
everywhere, almost certainly unintentionally.
The way is left open for Cabal to allow packages to specify cc-options
that get propagated in the future, if we find a use case for this.
let verb = getVerbFlag dflags
- pkg_extra_cc_opts <- getPackageExtraCcOpts dflags pkgs
+ -- cc-options are not passed when compiling .hc files. Our
+ -- hc code doesn't not #include any header files anyway, so these
+ -- options aren't necessary.
+ pkg_extra_cc_opts <-
+ if cc_phase `eqPhase` HCc
+ then return []
+ else getPackageExtraCcOpts dflags pkgs
#ifdef darwin_TARGET_OS
pkg_framework_paths <- getPackageFrameworkPath dflags pkgs