diff options
-rw-r--r-- | hadrian/doc/flavours.md | 4 | ||||
-rw-r--r-- | hadrian/src/Flavour.hs | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/hadrian/doc/flavours.md b/hadrian/doc/flavours.md index 4dac301dad..c58398844f 100644 --- a/hadrian/doc/flavours.md +++ b/hadrian/doc/flavours.md @@ -215,6 +215,10 @@ The supported transformers are listed below: default to loading static rather than dynamic library when, e.g., loading libraries during TemplateHaskell evaluations.</td> </tr> + <tr> + <td><code>no_profiled_libs</code></td> + <td>Disables building of libraries in profiled build ways.</td> + </tr> </table> ## Ways diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs index ec9bfa2c5b..7339eb6fb1 100644 --- a/hadrian/src/Flavour.hs +++ b/hadrian/src/Flavour.hs @@ -11,6 +11,7 @@ module Flavour , viaLlvmBackend , enableProfiledGhc , disableDynamicGhcPrograms + , disableProfiledLibs ) where import Expression @@ -90,6 +91,7 @@ flavourTransformers = M.fromList , "llvm" =: viaLlvmBackend , "profiled_ghc" =: enableProfiledGhc , "no_dynamic_ghc" =: disableDynamicGhcPrograms + , "no_profiled_libs" =: disableProfiledLibs ] where (=:) = (,) @@ -212,3 +214,8 @@ enableProfiledGhc flavour = flavour { ghcProfiled = True } -- | Disable 'dynamicGhcPrograms'. disableDynamicGhcPrograms :: Flavour -> Flavour disableDynamicGhcPrograms flavour = flavour { dynamicGhcPrograms = pure False } + +-- | Don't build libraries in profiled 'Way's. +disableProfiledLibs :: Flavour -> Flavour +disableProfiledLibs flavour = + flavour { libraryWays = filter (not . wayUnit Profiling) <$> libraryWays flavour } |