aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Main.hs25
-rw-r--r--example_project/fpm.toml2
2 files changed, 16 insertions, 11 deletions
diff --git a/app/Main.hs b/app/Main.hs
index 8d07c40..e9b0737 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -36,13 +36,12 @@ newtype Arguments = Arguments { command' :: Command }
data TomlSettings = TomlSettings {
tomlSettingsCompiler :: !Text
, tomlSettingsProjectName :: !Text
- , tomlSettingsDebugOptions :: ![Text]
, tomlSettingsLibrary :: !(Maybe Library) }
data AppSettings = AppSettings {
appSettingsCompiler :: !Text
, appSettingsProjectName :: !Text
- , appSettingsDebugOptions :: ![Text]
+ , appSettingsFlags :: ![Text]
, appSettingsLibrary :: !(Maybe Library) }
data Library = Library { librarySourceDir :: !Text }
@@ -71,7 +70,7 @@ build settings = do
putStrLn "Building"
let compiler = unpack $ appSettingsCompiler settings
let projectName = unpack $ appSettingsProjectName settings
- let flags = map unpack $ appSettingsDebugOptions settings
+ let flags = map unpack $ appSettingsFlags settings
case appSettingsLibrary settings of
Just librarySettings -> do
let librarySourceDir' = unpack $ librarySourceDir librarySettings
@@ -138,8 +137,6 @@ settingsCodec =
.= tomlSettingsCompiler
<*> Toml.text "name"
.= tomlSettingsProjectName
- <*> Toml.arrayOf Toml._Text "debug-options"
- .= tomlSettingsDebugOptions
<*> Toml.dioptional (Toml.table libraryCodec "library")
.= tomlSettingsLibrary
@@ -150,10 +147,20 @@ toml2AppSettings :: TomlSettings -> IO AppSettings
toml2AppSettings tomlSettings = do
librarySettings <- getLibrarySettings $ tomlSettingsLibrary tomlSettings
return AppSettings
- { appSettingsCompiler = tomlSettingsCompiler tomlSettings
- , appSettingsProjectName = tomlSettingsProjectName tomlSettings
- , appSettingsDebugOptions = tomlSettingsDebugOptions tomlSettings
- , appSettingsLibrary = librarySettings
+ { appSettingsCompiler = tomlSettingsCompiler tomlSettings
+ , appSettingsProjectName = tomlSettingsProjectName tomlSettings
+ , appSettingsFlags = [ "-Wall"
+ , "-Wextra"
+ , "-Wimplicit-interface"
+ , "-Werror"
+ , "-fPIC"
+ , "-fmax-errors=1"
+ , "-g"
+ , "-fbounds-check"
+ , "-fcheck-array-temporaries"
+ , "-fbacktrace"
+ ]
+ , appSettingsLibrary = librarySettings
}
getLibrarySettings :: Maybe Library -> IO (Maybe Library)
diff --git a/example_project/fpm.toml b/example_project/fpm.toml
index fae3512..f2ae1c8 100644
--- a/example_project/fpm.toml
+++ b/example_project/fpm.toml
@@ -6,8 +6,6 @@ maintainer = "example@example.com"
copyright = "2020 Author"
dependencies = []
compiler = "gfortran"
-debug-options = ["-g", "-Wall", "-Wextra", "-Werror", "-pedantic"]
-release-options = ["-O3"]
[executables.example_project]
main = "main.f90"