on master help sign in
Add fusion-plugin flag to build benchmarks and tests
commitd0a8f0f6784fb7f6c7551f60c28b30a3a7ebdb37 authorHarendra Kumar <harendra.kumar@gmail.com> dateSat 25 Jan 2020, 18:49 (7 years ago) parentbd33fc7
1 file changed+22
streamly.cabal+22
streamly.cabal+22
@@ -129,6 +129,11 @@ source-repository head
129129 type: git
130130 location: https://github.com/composewell/streamly
131131
132+flag fusion-plugin
133+ description: Enable fusion plugin for better optimizations
134+ manual: True
135+ default: False
136+
132137flag inspection
133138 description: Enable inspection testing
134139 manual: True
@@ -237,18 +242,31 @@ common lib-options
237242-- in general.
238243common test-options
239244 import: compile-options, threading-options
245+
240246 ghc-options: -O0
241247 -fno-ignore-asserts
248+ if flag(fusion-plugin)
249+ ghc-options: -fplugin Fusion.Plugin
250+ build-depends:
251+ fusion-plugin >= 0.1 && < 0.2
242252
243253-- Used by maxrate test, benchmarks and executables
244254common exe-options
245255 import: compile-options, optimization-options, threading-options
256+ if flag(fusion-plugin)
257+ ghc-options: -fplugin Fusion.Plugin
258+ build-depends:
259+ fusion-plugin >= 0.1 && < 0.2
246260
247261-- Some benchmarks are threaded some are not
248262-- XXX dependencies should be separated under bench-depends
249263common bench-options
250264 import: compile-options, optimization-options
251265 ghc-options: -with-rtsopts "-T -M256M"
266+ if flag(fusion-plugin)
267+ ghc-options: -fplugin Fusion.Plugin
268+ build-depends:
269+ fusion-plugin >= 0.1 && < 0.2
252270 build-depends: mtl >= 2.2 && < 3
253271
254272common bench-options-threaded
@@ -256,6 +274,10 @@ common bench-options-threaded
256274 -- -threaded and -N2 is important because some GC and space leak issues
257275 -- trigger only with these options.
258276 ghc-options: -threaded -with-rtsopts "-T -N2 -M256M"
277+ if flag(fusion-plugin)
278+ ghc-options: -fplugin Fusion.Plugin
279+ build-depends:
280+ fusion-plugin >= 0.1 && < 0.2
259281 build-depends: mtl >= 2.2 && < 3
260282
261283-------------------------------------------------------------------------------