on master help sign in
Add fusion-plugin flag to build benchmarks and tests
d0a8f0fHarendra Kumar
streamly.cabal+22
@@ -129,6 +129,11 @@ source-repository head
129 type: git
129 type: git
130 location: https://github.com/composewell/streamly
130 location: https://github.com/composewell/streamly
131
131
132+flag fusion-plugin
133+ description: Enable fusion plugin for better optimizations
134+ manual: True
135+ default: False
136+
132flag inspection
137flag inspection
133 description: Enable inspection testing
138 description: Enable inspection testing
134 manual: True
139 manual: True
@@ -237,18 +242,31 @@ common lib-options
237-- in general.
242-- in general.
238common test-options
243common test-options
239 import: compile-options, threading-options
244 import: compile-options, threading-options
245+
240 ghc-options: -O0
246 ghc-options: -O0
241 -fno-ignore-asserts
247 -fno-ignore-asserts
248+ if flag(fusion-plugin)
249+ ghc-options: -fplugin Fusion.Plugin
250+ build-depends:
251+ fusion-plugin >= 0.1 && < 0.2
242
252
243-- Used by maxrate test, benchmarks and executables
253-- Used by maxrate test, benchmarks and executables
244common exe-options
254common exe-options
245 import: compile-options, optimization-options, threading-options
255 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
246
260
247-- Some benchmarks are threaded some are not
261-- Some benchmarks are threaded some are not
248-- XXX dependencies should be separated under bench-depends
262-- XXX dependencies should be separated under bench-depends
249common bench-options
263common bench-options
250 import: compile-options, optimization-options
264 import: compile-options, optimization-options
251 ghc-options: -with-rtsopts "-T -M256M"
265 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
252 build-depends: mtl >= 2.2 && < 3
270 build-depends: mtl >= 2.2 && < 3
253
271
254common bench-options-threaded
272common bench-options-threaded
@@ -256,6 +274,10 @@ common bench-options-threaded
256 -- -threaded and -N2 is important because some GC and space leak issues
274 -- -threaded and -N2 is important because some GC and space leak issues
257 -- trigger only with these options.
275 -- trigger only with these options.
258 ghc-options: -threaded -with-rtsopts "-T -N2 -M256M"
276 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
259 build-depends: mtl >= 2.2 && < 3
281 build-depends: mtl >= 2.2 && < 3
260
282
261-------------------------------------------------------------------------------
283-------------------------------------------------------------------------------