From ed1173a7b3c77c670c1158fd2cb82ef8657dfecc Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Fri, 11 Jul 2008 13:43:01 +0000 Subject: [PATCH] FIX #2278: don't complain if the -odir directory doesn't exist we'll create it anyway --- compiler/main/Main.hs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/compiler/main/Main.hs b/compiler/main/Main.hs index a42a678..a91df13 100644 --- a/compiler/main/Main.hs +++ b/compiler/main/Main.hs @@ -46,7 +46,6 @@ import Panic -- Standard Haskell libraries import Control.Exception ( throwDyn ) import System.IO -import System.Directory ( doesDirectoryExist ) import System.Environment import System.Exit import System.FilePath @@ -285,11 +284,7 @@ checkOptions cli_mode dflags srcs objs = do -- verifyOutputFiles :: DynFlags -> IO () verifyOutputFiles dflags = do - let odir = objectDir dflags - when (isJust odir) $ do - let dir = fromJust odir - flg <- doesDirectoryExist dir - when (not flg) (nonExistentDir "-odir" dir) + -- not -odir: we create the directory for -odir if it doesn't exist (#2278). let ofile = outputFile dflags when (isJust ofile) $ do let fn = fromJust ofile -- 1.7.10.4