diff options
Diffstat (limited to 'hadrian/src/Settings')
-rw-r--r-- | hadrian/src/Settings/Builders/Ghc.hs | 3 | ||||
-rw-r--r-- | hadrian/src/Settings/Default.hs | 12 | ||||
-rw-r--r-- | hadrian/src/Settings/Default.hs-boot | 4 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/Benchmark.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/Development.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/GhcInGhci.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/Performance.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/Quick.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/QuickCross.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/Quickest.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/Validate.hs | 4 |
11 files changed, 18 insertions, 19 deletions
diff --git a/hadrian/src/Settings/Builders/Ghc.hs b/hadrian/src/Settings/Builders/Ghc.hs index aa243db30c..947172ecb8 100644 --- a/hadrian/src/Settings/Builders/Ghc.hs +++ b/hadrian/src/Settings/Builders/Ghc.hs @@ -39,6 +39,7 @@ toolArgs = do , map ("-optc" ++) <$> getStagedSettingList ConfCcArgs , map ("-optP" ++) <$> getStagedSettingList ConfCppArgs , map ("-optP" ++) <$> getContextData cppOpts + , getContextData hcOpts ] compileAndLinkHs :: Args @@ -228,6 +229,8 @@ commonGhcArgs = do -- input hash to avoid superfluous recompilation, avoiding -- #18672. arg "-fdiagnostics-color=always" + -- Important this is last.. as these options can override the default options + , getContextData hcOpts ] -- TODO: Do '-ticky' in all debug ways? diff --git a/hadrian/src/Settings/Default.hs b/hadrian/src/Settings/Default.hs index 55e56b2212..378fc27a94 100644 --- a/hadrian/src/Settings/Default.hs +++ b/hadrian/src/Settings/Default.hs @@ -7,7 +7,7 @@ module Settings.Default ( -- * Default command line arguments for various builders SourceArgs (..), sourceArgs, defaultBuilderArgs, defaultPackageArgs, - defaultArgs, + defaultExtraArgs, -- * Default build flavour and BigNum backend defaultFlavour, defaultBignumBackend @@ -210,7 +210,6 @@ data SourceArgs = SourceArgs sourceArgs :: SourceArgs -> Args sourceArgs SourceArgs {..} = builder Ghc ? mconcat [ hsDefault - , getContextData hcOpts -- `compiler` is also a library but the specific arguments that we want -- to apply to that are given by the hsCompiler option. `ghc` is an -- executable so we don't have to exclude that. @@ -219,11 +218,8 @@ sourceArgs SourceArgs {..} = builder Ghc ? mconcat , package ghc ? hsGhc ] -- | All default command line arguments. -defaultArgs :: Args -defaultArgs = mconcat - [ defaultBuilderArgs - , sourceArgs defaultSourceArgs - , defaultPackageArgs ] +defaultExtraArgs :: Args +defaultExtraArgs = sourceArgs defaultSourceArgs -- | Default source arguments, e.g. optimisation settings. defaultSourceArgs :: SourceArgs @@ -241,7 +237,7 @@ defaultSourceArgs = SourceArgs defaultFlavour :: Flavour defaultFlavour = Flavour { name = "default" - , args = defaultArgs + , extraArgs = defaultExtraArgs , packages = defaultPackages , bignumBackend = defaultBignumBackend , bignumCheck = False diff --git a/hadrian/src/Settings/Default.hs-boot b/hadrian/src/Settings/Default.hs-boot index da5fb27b50..d2774be72d 100644 --- a/hadrian/src/Settings/Default.hs-boot +++ b/hadrian/src/Settings/Default.hs-boot @@ -1,6 +1,6 @@ module Settings.Default ( SourceArgs (..), sourceArgs, defaultBuilderArgs, defaultPackageArgs, - defaultArgs, defaultLibraryWays, defaultRtsWays, + defaultExtraArgs, defaultLibraryWays, defaultRtsWays, defaultFlavour, defaultBignumBackend ) where @@ -15,7 +15,7 @@ data SourceArgs = SourceArgs sourceArgs :: SourceArgs -> Args -defaultBuilderArgs, defaultPackageArgs, defaultArgs :: Args +defaultBuilderArgs, defaultPackageArgs, defaultExtraArgs :: Args defaultLibraryWays, defaultRtsWays :: Ways defaultFlavour :: Flavour defaultBignumBackend :: String diff --git a/hadrian/src/Settings/Flavours/Benchmark.hs b/hadrian/src/Settings/Flavours/Benchmark.hs index 3715e6505d..7ae8b4b160 100644 --- a/hadrian/src/Settings/Flavours/Benchmark.hs +++ b/hadrian/src/Settings/Flavours/Benchmark.hs @@ -10,7 +10,7 @@ import {-# SOURCE #-} Settings.Default benchmarkFlavour :: Flavour benchmarkFlavour = defaultFlavour { name = "bench" - , args = defaultBuilderArgs <> benchmarkArgs <> defaultPackageArgs + , extraArgs = benchmarkArgs , libraryWays = pure $ Set.fromList [vanilla] , rtsWays = Set.fromList <$> mconcat [pure [vanilla], targetSupportsThreadedRts ? pure [threaded]] } diff --git a/hadrian/src/Settings/Flavours/Development.hs b/hadrian/src/Settings/Flavours/Development.hs index c710d8855f..5a7a3cbfee 100644 --- a/hadrian/src/Settings/Flavours/Development.hs +++ b/hadrian/src/Settings/Flavours/Development.hs @@ -12,7 +12,7 @@ import {-# SOURCE #-} Settings.Default developmentFlavour :: Stage -> Flavour developmentFlavour ghcStage = defaultFlavour { name = "devel" ++ stageString ghcStage - , args = defaultBuilderArgs <> developmentArgs ghcStage <> defaultPackageArgs + , extraArgs = developmentArgs ghcStage , libraryWays = pure $ Set.fromList [vanilla] , rtsWays = Set.fromList <$> mconcat [pure [vanilla, debug], targetSupportsThreadedRts ? pure [threaded, threadedDebug]] , dynamicGhcPrograms = return False diff --git a/hadrian/src/Settings/Flavours/GhcInGhci.hs b/hadrian/src/Settings/Flavours/GhcInGhci.hs index fc956518f9..b2fb5d4806 100644 --- a/hadrian/src/Settings/Flavours/GhcInGhci.hs +++ b/hadrian/src/Settings/Flavours/GhcInGhci.hs @@ -11,7 +11,7 @@ import {-# SOURCE #-} Settings.Default ghcInGhciFlavour :: Flavour ghcInGhciFlavour = defaultFlavour { name = "ghc-in-ghci" - , args = defaultBuilderArgs <> ghciArgs <> defaultPackageArgs + , extraArgs = ghciArgs -- We can't build DLLs on Windows (yet). Actually we should only -- include the dynamic way when we have a dynamic host GHC, but just -- checking for Windows seems simpler for now. diff --git a/hadrian/src/Settings/Flavours/Performance.hs b/hadrian/src/Settings/Flavours/Performance.hs index a856bc9d17..c4ad7b65d3 100644 --- a/hadrian/src/Settings/Flavours/Performance.hs +++ b/hadrian/src/Settings/Flavours/Performance.hs @@ -8,7 +8,7 @@ import {-# SOURCE #-} Settings.Default performanceFlavour :: Flavour performanceFlavour = splitSections $ defaultFlavour { name = "perf" - , args = defaultBuilderArgs <> performanceArgs <> defaultPackageArgs } + , extraArgs = performanceArgs } performanceArgs :: Args performanceArgs = sourceArgs SourceArgs diff --git a/hadrian/src/Settings/Flavours/Quick.hs b/hadrian/src/Settings/Flavours/Quick.hs index 6df22c5712..fe804240a0 100644 --- a/hadrian/src/Settings/Flavours/Quick.hs +++ b/hadrian/src/Settings/Flavours/Quick.hs @@ -15,7 +15,7 @@ import {-# SOURCE #-} Settings.Default quickFlavour :: Flavour quickFlavour = defaultFlavour { name = "quick" - , args = defaultBuilderArgs <> quickArgs <> defaultPackageArgs + , extraArgs = quickArgs , libraryWays = Set.fromList <$> mconcat [ pure [vanilla] diff --git a/hadrian/src/Settings/Flavours/QuickCross.hs b/hadrian/src/Settings/Flavours/QuickCross.hs index 152a3c5641..036301aae0 100644 --- a/hadrian/src/Settings/Flavours/QuickCross.hs +++ b/hadrian/src/Settings/Flavours/QuickCross.hs @@ -11,7 +11,7 @@ import {-# SOURCE #-} Settings.Default quickCrossFlavour :: Flavour quickCrossFlavour = defaultFlavour { name = "quick-cross" - , args = defaultBuilderArgs <> quickCrossArgs <> defaultPackageArgs + , extraArgs = quickCrossArgs , dynamicGhcPrograms = pure False , libraryWays = Set.fromList <$> mconcat diff --git a/hadrian/src/Settings/Flavours/Quickest.hs b/hadrian/src/Settings/Flavours/Quickest.hs index 318e7c8359..9eed80116b 100644 --- a/hadrian/src/Settings/Flavours/Quickest.hs +++ b/hadrian/src/Settings/Flavours/Quickest.hs @@ -11,7 +11,7 @@ import {-# SOURCE #-} Settings.Default quickestFlavour :: Flavour quickestFlavour = defaultFlavour { name = "quickest" - , args = defaultBuilderArgs <> quickestArgs <> defaultPackageArgs + , extraArgs = quickestArgs , libraryWays = pure (Set.fromList [vanilla]) , rtsWays = pure (Set.fromList [vanilla]) <> (targetSupportsThreadedRts ? pure (Set.fromList [threaded])) , dynamicGhcPrograms = return False } diff --git a/hadrian/src/Settings/Flavours/Validate.hs b/hadrian/src/Settings/Flavours/Validate.hs index f70e33cb98..493645b072 100644 --- a/hadrian/src/Settings/Flavours/Validate.hs +++ b/hadrian/src/Settings/Flavours/Validate.hs @@ -12,7 +12,7 @@ import {-# SOURCE #-} Settings.Default validateFlavour :: Flavour validateFlavour = enableLinting $ werror $ defaultFlavour { name = "validate" - , args = defaultBuilderArgs <> validateArgs <> defaultPackageArgs + , extraArgs = validateArgs , libraryWays = Set.fromList <$> mconcat [ pure [vanilla] , notStage0 ? platformSupportsSharedLibs ? pure [dynamic] @@ -60,4 +60,4 @@ quickValidateArgs = sourceArgs SourceArgs quickValidateFlavour :: Flavour quickValidateFlavour = werror $ validateFlavour { name = "quick-validate" - , args = defaultBuilderArgs <> quickValidateArgs <> defaultPackageArgs } + , extraArgs = quickValidateArgs } |