Commit 17b7cf1a authored by Simon Marlow's avatar Simon Marlow

add defaultObjectTarget to the GHC API

We had no way of getting the right value of HscTarget to use to
request object files as output.
parent 3ceff7a4
......@@ -17,7 +17,7 @@ module DynFlags (
-- Dynamic flags
DynFlag(..),
DynFlags(..),
HscTarget(..), isObjectTarget,
HscTarget(..), isObjectTarget, defaultObjectTarget,
GhcMode(..), isOneShot,
GhcLink(..), isNoLink,
PackageFlag(..),
......@@ -366,7 +366,11 @@ data PackageFlag
| IgnorePackage String
deriving Eq
defaultHscTarget
defaultHscTarget = defaultObjectTarget
-- | the 'HscTarget' value corresponding to the default way to create
-- object files on the current platform.
defaultObjectTarget
| cGhcWithNativeCodeGen == "YES" = HscAsm
| otherwise = HscC
......
......@@ -15,7 +15,7 @@ module GHC (
-- * Flags and settings
DynFlags(..), DynFlag(..), Severity(..), HscTarget(..), dopt,
GhcMode(..), GhcLink(..),
GhcMode(..), GhcLink(..), defaultObjectTarget,
parseDynamicFlags,
getSessionDynFlags,
setSessionDynFlags,
......
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