Commit 39271273 authored by Simon Marlow's avatar Simon Marlow

Don't use the cc-options from packages when compiling .hc files

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.
parent cc45450c
......@@ -852,7 +852,13 @@ runPhase cc_phase _stop hsc_env _basename _suff input_fn get_output_fn maybe_loc
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment