Change the way in which the .exe suffix to the output file is added. The reason
is that "-o main" will generate main.exe on Windows while the doesFileExists "main"
in DriverPipeline.link will return False.
exeFileName :: DynFlags -> FilePath
exeFileName dflags
- | Just s <- outputFile dflags = s
+ | Just s <- outputFile dflags =
+#if defined(mingw32_HOST_OS)
+ if null (suffixOf s)
+ then s `joinFileExt` "exe"
+ else s
+#else
+ s
+#endif
| otherwise =
#if defined(mingw32_HOST_OS)
"main.exe"
let isMain = (== mainModIs dflags) . ms_mod
[ms] <- return (filter isMain mod_graph)
ml_hs_file (ms_location ms)
-#if defined(mingw32_HOST_OS)
- guessedName = fmap (\fname -> basenameOf fname `joinFileExt` "exe") mainModuleSrcPath
-#else
guessedName = fmap basenameOf mainModuleSrcPath
-#endif
in
case outputFile dflags of
Just _ -> env