aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/src/Fpm.hs
diff options
context:
space:
mode:
authorBrad Richardson <everythingfunctional@protonmail.com>2020-11-09 16:42:18 -0600
committerBrad Richardson <everythingfunctional@protonmail.com>2020-11-09 16:42:18 -0600
commited3f9c6cf742620a873eb794896ef232d606a614 (patch)
treee5fc0cba57e102386fc0ebc0ed046545047dfa0b /bootstrap/src/Fpm.hs
parent3c6440b42b754ca2a14a746012e3592e26ca7782 (diff)
downloadfpm-ed3f9c6cf742620a873eb794896ef232d606a614.tar.gz
fpm-ed3f9c6cf742620a873eb794896ef232d606a614.zip
Fix formatting
Diffstat (limited to 'bootstrap/src/Fpm.hs')
-rw-r--r--bootstrap/src/Fpm.hs71
1 files changed, 61 insertions, 10 deletions
diff --git a/bootstrap/src/Fpm.hs b/bootstrap/src/Fpm.hs
index db79f5e..b076459 100644
--- a/bootstrap/src/Fpm.hs
+++ b/bootstrap/src/Fpm.hs
@@ -34,7 +34,7 @@ import Development.Shake.FilePath ( (</>)
, exe
, splitDirectories
)
-import Numeric (showHex)
+import Numeric ( showHex )
import Options.Applicative ( Parser
, (<**>)
, (<|>)
@@ -435,7 +435,9 @@ runArguments =
<*> optional
(many
(strArgument
- (metavar "ARGS" <> help "Arguments to the executable(s) (should follow '--')")
+ ( metavar "ARGS"
+ <> help "Arguments to the executable(s) (should follow '--')"
+ )
)
)
@@ -462,11 +464,16 @@ testArguments =
)
)
<*> optional
- (strOption (long "target" <> metavar "TARGET" <> help "Name of the test to run"))
+ (strOption
+ (long "target" <> metavar "TARGET" <> help "Name of the test to run"
+ )
+ )
<*> optional
(many
(strArgument
- (metavar "ARGS" <> help "Arguments to the test(s) (should follow '--')")
+ ( metavar "ARGS"
+ <> help "Arguments to the test(s) (should follow '--')"
+ )
)
)
@@ -591,8 +598,8 @@ toml2AppSettings tomlSettings args = do
(tomlSettingsExecutables tomlSettings)
projectName
testSettings <- getTestSettings $ tomlSettingsTests tomlSettings
- flags <- defineFlags specifiedFlags compiler release
- buildPrefix <- makeBuildPrefix compiler flags
+ flags <- defineFlags specifiedFlags compiler release
+ buildPrefix <- makeBuildPrefix compiler flags
let dependencies = tomlSettingsDependencies tomlSettings
let devDependencies = tomlSettingsDevDependencies tomlSettings
return AppSettings { appSettingsCompiler = compiler
@@ -608,11 +615,55 @@ toml2AppSettings tomlSettings args = do
defineFlags :: [String] -> FilePath -> Bool -> IO [String]
defineFlags [] compiler release
- | "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"]
- | "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"]
+ | "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"
+ ]
+ | "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"
+ ]
| otherwise = do
- putStrLn $ "Sorry, compiler is currently unsupported: " ++ compiler
- exitWith (ExitFailure 1)
+ putStrLn $ "Sorry, compiler is currently unsupported: " ++ compiler
+ exitWith (ExitFailure 1)
defineFlags specifiedFlags _ _ = return specifiedFlags
getLibrarySettings :: Maybe Library -> IO (Maybe Library)