From 623a9d5a2f4decf0bb71f8d44d21148b141f6204 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Tue, 31 Mar 2020 15:27:30 -0500 Subject: Remove compiler flags from toml --- app/Main.hs | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'app') 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) -- cgit v1.2.3