| ... |
... |
@@ -14,6 +14,7 @@ module Flavour |
|
14
|
14
|
, enableProfiledGhc
|
|
15
|
15
|
, disableDynamicGhcPrograms
|
|
16
|
16
|
, disableDynamicLibs
|
|
|
17
|
+ , enableProfiledLibs
|
|
17
|
18
|
, disableProfiledLibs
|
|
18
|
19
|
, enableLinting
|
|
19
|
20
|
, enableHaddock
|
| ... |
... |
@@ -59,6 +60,7 @@ flavourTransformers = M.fromList |
|
59
|
60
|
, "no_dynamic_libs" =: disableDynamicLibs
|
|
60
|
61
|
, "native_bignum" =: useNativeBignum
|
|
61
|
62
|
, "text_simdutf" =: enableTextWithSIMDUTF
|
|
|
63
|
+ , "with_profiled_libs" =: enableProfiledLibs
|
|
62
|
64
|
, "no_profiled_libs" =: disableProfiledLibs
|
|
63
|
65
|
, "omit_pragmas" =: omitPragmas
|
|
64
|
66
|
, "ipe" =: enableIPE
|
| ... |
... |
@@ -301,6 +303,17 @@ disableDynamicLibs flavour = |
|
301
|
303
|
prune :: Ways -> Ways
|
|
302
|
304
|
prune = fmap $ Set.filter (not . wayUnit Dynamic)
|
|
303
|
305
|
|
|
|
306
|
+-- | Build libraries and the RTS in profiled ways (opposite of
|
|
|
307
|
+-- 'disableProfiledLibs').
|
|
|
308
|
+enableProfiledLibs :: Flavour -> Flavour
|
|
|
309
|
+enableProfiledLibs flavour =
|
|
|
310
|
+ flavour
|
|
|
311
|
+ { libraryWays = addProfilingWays $ libraryWays flavour
|
|
|
312
|
+ , rtsWays = addProfilingWays $ rtsWays flavour
|
|
|
313
|
+ }
|
|
|
314
|
+ where
|
|
|
315
|
+ addProfilingWays :: Ways -> Ways
|
|
|
316
|
+ addProfilingWays ways = fmap (\ws -> ws <> Set.map (<> profiling) ws) ways
|
|
304
|
317
|
|
|
305
|
318
|
-- | Don't build libraries in profiled 'Way's.
|
|
306
|
319
|
disableProfiledLibs :: Flavour -> Flavour
|