Commit 06ac07df authored by Ben Gamari's avatar Ben Gamari 🐢

shake: Add support for --compiler-args

parent 8dc0e47f
......@@ -65,6 +65,7 @@ data Nofib
,way :: [String]
,threads :: Int
,compiler :: String
,compiler_args :: String
,tag :: String
,output :: String
,run :: Maybe Speed
......@@ -88,6 +89,7 @@ nofibMode = cmdArgsMode $ modes
,way = [] &= help "Which way to build, defaults to -O1"
,threads = 1 &= name "j" &= typ "NUM" &= help "Number of threads, defaults to 1"
,compiler = "ghc" &= help "Compiler to use, defaults to ghc"
,compiler_args = "" &= help "Extra arguments to pass to the Compiler when building tests"
,tag = "" &= help "Tag to name the compiler, defaults to compiler --version"
,output = "" &= help "Where to put created files under _make, defaults to tag/way"
,run = Nothing &= groupname "Running" &= opt "norm" &= help "Run the results (Fast,Norm,Slow)"
......@@ -266,7 +268,7 @@ buildRules nofib@Build{..} = do
resultHdl <- liftIO $ openFile result WriteMode
liftIO $ hPutStrLn resultHdl $ "==nofib== " ++ name ++ " : time to compile " ++ mod ++ " follows..."
Stdouterr out_err <- cmd compiler $ ["-Rghc-timing","-c",src,"-w","-i"++obj,"-odir="++obj,"-hidir="++obj] ++
way ++ words (config "SRC_HC_OPTS")
way ++ words (config "SRC_HC_OPTS") ++ [compiler_args]
liftIO $ BS.hPutStr resultHdl out_err
liftIO $ hPutStrLn resultHdl $ "==nofib== " ++ name ++ ": size of " ++ takeFileName o ++ " follows..."
Stdout out_err <- cmd "size" [o]
......
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