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

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 ( ...@@ -17,7 +17,7 @@ module DynFlags (
-- Dynamic flags -- Dynamic flags
DynFlag(..), DynFlag(..),
DynFlags(..), DynFlags(..),
HscTarget(..), isObjectTarget, HscTarget(..), isObjectTarget, defaultObjectTarget,
GhcMode(..), isOneShot, GhcMode(..), isOneShot,
GhcLink(..), isNoLink, GhcLink(..), isNoLink,
PackageFlag(..), PackageFlag(..),
...@@ -366,7 +366,11 @@ data PackageFlag ...@@ -366,7 +366,11 @@ data PackageFlag
| IgnorePackage String | IgnorePackage String
deriving Eq 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 | cGhcWithNativeCodeGen == "YES" = HscAsm
| otherwise = HscC | otherwise = HscC
......
...@@ -15,7 +15,7 @@ module GHC ( ...@@ -15,7 +15,7 @@ module GHC (
-- * Flags and settings -- * Flags and settings
DynFlags(..), DynFlag(..), Severity(..), HscTarget(..), dopt, DynFlags(..), DynFlag(..), Severity(..), HscTarget(..), dopt,
GhcMode(..), GhcLink(..), GhcMode(..), GhcLink(..), defaultObjectTarget,
parseDynamicFlags, parseDynamicFlags,
getSessionDynFlags, getSessionDynFlags,
setSessionDynFlags, 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