Disable obj loading for targets (Fix #554)

This commit is contained in:
Daniel Gröber 2015-09-10 07:48:13 +02:00
parent 6ad71af001
commit e92bd0af48
2 changed files with 10 additions and 11 deletions

View File

@ -223,22 +223,19 @@ withInteractiveContext action = gbracket setup teardown body
topImports >>= setCtx
action
topImports = do
mss <- getModuleGraph
mns <- map modName <$> filterM isTop mss
let ii = map IIModule mns
ms <- filterM moduleIsInterpreted =<< map ms_mod <$> getModuleGraph
liftIO $ print (map modName ms)
let iis = map (IIModule . modName) ms
#if __GLASGOW_HASKELL__ >= 704
return ii
return iis
#else
return (ii,[])
return (iis,[])
#endif
isTop mos = lookupMod mos ||> returnFalse
lookupMod mos = lookupModule (ms_mod_name mos) Nothing >> return True
returnFalse = return False
#if __GLASGOW_HASKELL__ >= 706
modName = moduleName . ms_mod
modName = moduleName
setCtx = setContext
#elif __GLASGOW_HASKELL__ >= 704
modName = ms_mod
modName = id
setCtx = setContext
#else
modName = ms_mod

View File

@ -409,12 +409,14 @@ resolveGmComponents mumns cs = do
-- | Set the files as targets and load them.
loadTargets :: IOish m => [GHCOption] -> [FilePath] -> GmlT m ()
loadTargets opts targetStrs = do
targets <-
targets' <-
withLightHscEnv opts $ \env ->
liftM (nubBy ((==) `on` targetId))
(mapM ((`guessTarget` Nothing) >=> mapFile env) targetStrs)
>>= mapM relativize
let targets = map (\t -> t { targetAllowObjCode = False }) targets'
gmLog GmDebug "loadTargets" $
text "Loading" <+>: fsep (map (text . showTargetId) targets)