Skip to content

Commit ed3f9c6

Browse files
Fix formatting
1 parent 3c6440b commit ed3f9c6

File tree

1 file changed

+61
-10
lines changed

1 file changed

+61
-10
lines changed

bootstrap/src/Fpm.hs

Lines changed: 61 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import Development.Shake.FilePath ( (</>)
3434
, exe
3535
, splitDirectories
3636
)
37-
import Numeric (showHex)
37+
import Numeric ( showHex )
3838
import Options.Applicative ( Parser
3939
, (<**>)
4040
, (<|>)
@@ -435,7 +435,9 @@ runArguments =
435435
<*> optional
436436
(many
437437
(strArgument
438-
(metavar "ARGS" <> help "Arguments to the executable(s) (should follow '--')")
438+
( metavar "ARGS"
439+
<> help "Arguments to the executable(s) (should follow '--')"
440+
)
439441
)
440442
)
441443

@@ -462,11 +464,16 @@ testArguments =
462464
)
463465
)
464466
<*> optional
465-
(strOption (long "target" <> metavar "TARGET" <> help "Name of the test to run"))
467+
(strOption
468+
(long "target" <> metavar "TARGET" <> help "Name of the test to run"
469+
)
470+
)
466471
<*> optional
467472
(many
468473
(strArgument
469-
(metavar "ARGS" <> help "Arguments to the test(s) (should follow '--')")
474+
( metavar "ARGS"
475+
<> help "Arguments to the test(s) (should follow '--')"
476+
)
470477
)
471478
)
472479

@@ -591,8 +598,8 @@ toml2AppSettings tomlSettings args = do
591598
(tomlSettingsExecutables tomlSettings)
592599
projectName
593600
testSettings <- getTestSettings $ tomlSettingsTests tomlSettings
594-
flags <- defineFlags specifiedFlags compiler release
595-
buildPrefix <- makeBuildPrefix compiler flags
601+
flags <- defineFlags specifiedFlags compiler release
602+
buildPrefix <- makeBuildPrefix compiler flags
596603
let dependencies = tomlSettingsDependencies tomlSettings
597604
let devDependencies = tomlSettingsDevDependencies tomlSettings
598605
return AppSettings { appSettingsCompiler = compiler
@@ -608,11 +615,55 @@ toml2AppSettings tomlSettings args = do
608615

609616
defineFlags :: [String] -> FilePath -> Bool -> IO [String]
610617
defineFlags [] compiler release
611-
| "gfortran" `isInfixOf` compiler = return $ if release then [ "-Wall", "-Wextra", "-Wimplicit-interface", "-fPIC", "-fmax-errors=1", "-O3", "-march=native", "-ffast-math", "-funroll-loops"] else [ "-Wall", "-Wextra", "-Wimplicit-interface", "-fPIC", "-fmax-errors=1", "-g", "-fbounds-check", "-fcheck-array-temporaries", "-fbacktrace"]
612-
| "caf" `isInfixOf` compiler = return $ if release then [ "-Wall", "-Wextra", "-Wimplicit-interface", "-fPIC", "-fmax-errors=1", "-O3", "-march=native", "-ffast-math", "-funroll-loops"] else [ "-Wall", "-Wextra", "-Wimplicit-interface", "-fPIC", "-fmax-errors=1", "-g", "-fbounds-check", "-fcheck-array-temporaries", "-fbacktrace"]
618+
| "gfortran" `isInfixOf` compiler = return $ if release
619+
then
620+
[ "-Wall"
621+
, "-Wextra"
622+
, "-Wimplicit-interface"
623+
, "-fPIC"
624+
, "-fmax-errors=1"
625+
, "-O3"
626+
, "-march=native"
627+
, "-ffast-math"
628+
, "-funroll-loops"
629+
]
630+
else
631+
[ "-Wall"
632+
, "-Wextra"
633+
, "-Wimplicit-interface"
634+
, "-fPIC"
635+
, "-fmax-errors=1"
636+
, "-g"
637+
, "-fbounds-check"
638+
, "-fcheck-array-temporaries"
639+
, "-fbacktrace"
640+
]
641+
| "caf" `isInfixOf` compiler = return $ if release
642+
then
643+
[ "-Wall"
644+
, "-Wextra"
645+
, "-Wimplicit-interface"
646+
, "-fPIC"
647+
, "-fmax-errors=1"
648+
, "-O3"
649+
, "-march=native"
650+
, "-ffast-math"
651+
, "-funroll-loops"
652+
]
653+
else
654+
[ "-Wall"
655+
, "-Wextra"
656+
, "-Wimplicit-interface"
657+
, "-fPIC"
658+
, "-fmax-errors=1"
659+
, "-g"
660+
, "-fbounds-check"
661+
, "-fcheck-array-temporaries"
662+
, "-fbacktrace"
663+
]
613664
| otherwise = do
614-
putStrLn $ "Sorry, compiler is currently unsupported: " ++ compiler
615-
exitWith (ExitFailure 1)
665+
putStrLn $ "Sorry, compiler is currently unsupported: " ++ compiler
666+
exitWith (ExitFailure 1)
616667
defineFlags specifiedFlags _ _ = return specifiedFlags
617668

618669
getLibrarySettings :: Maybe Library -> IO (Maybe Library)

0 commit comments

Comments
 (0)