@@ -10,6 +10,11 @@ flag fusion-plugin
1010 manual: True
1111 default: False
1212
13+flag limit-build-mem
14+ description: Limits memory when building the executables
15+ manual: True
16+ default: False
17+
1318flag dev
1419 description: Development build
1520 manual: True
@@ -53,6 +58,7 @@ common compile-options
5358 -Wredundant-constraints
5459 -Wnoncanonical-monad-instances
5560 -Rghc-timing
61+ -fno-ignore-asserts
5662
5763 if flag(has-llvm)
5864 ghc-options: -fllvm
@@ -61,8 +67,8 @@ common compile-options
6167 ghc-options: -Wmissed-specialisations
6268 -Wall-missed-specialisations
6369
64− ghc-options: -fno-ignore-asserts
65− +RTS -M512M -RTS
70+ if flag(limit-build-mem)
71+ ghc-options: +RTS -M512M -RTS
6672
6773common default-extensions
6874 default-extensions:
@@ -146,10 +152,12 @@ common lib-options
146152
147153library
148154 import: lib-options, test-dependencies
149− ghc-options: +RTS -M1500M -RTS
150155 hs-source-dirs: lib
151156 exposed-modules: Streamly.Test.Common
152157 , Streamly.Test.Prelude.Common
158+ if flag(limit-build-mem)
159+ ghc-options: +RTS -M1500M -RTS
160+
153161
154162-------------------------------------------------------------------------------
155163-- Test suite options
@@ -222,13 +230,15 @@ test-suite Data.Parser
222230 import: test-options
223231 type: exitcode-stdio-1.0
224232 main-is: Streamly/Test/Data/Parser.hs
225− ghc-options: +RTS -M1000M -RTS
233+ if flag(limit-build-mem)
234+ ghc-options: +RTS -M1000M -RTS
226235
227236test-suite Data.Parser.ParserD
228237 import: test-options
229238 type: exitcode-stdio-1.0
230239 main-is: Streamly/Test/Data/Parser/ParserD.hs
231− ghc-options: +RTS -M1000M -RTS
240+ if flag(limit-build-mem)
241+ ghc-options: +RTS -M1000M -RTS
232242
233243test-suite Data.SmallArray
234244 import: test-options
@@ -287,7 +297,8 @@ test-suite Prelude.Concurrent
287297 type: exitcode-stdio-1.0
288298 main-is: Streamly/Test/Prelude/Concurrent.hs
289299 ghc-options: -main-is Streamly.Test.Prelude.Concurrent.main
290− +RTS -M2000M -RTS
300+ if flag(limit-build-mem)
301+ ghc-options: +RTS -M2000M -RTS
291302
292303test-suite Prelude.Fold
293304 import: test-options
@@ -316,7 +327,9 @@ test-suite Prelude.Serial
316327 type: exitcode-stdio-1.0
317328 main-is: Streamly/Test/Prelude/Serial.hs
318329 ghc-options: -main-is Streamly.Test.Prelude.Serial.main
319− +RTS -M1500M -RTS
330+ if flag(limit-build-mem)
331+ ghc-options: +RTS -M1500M -RTS
332+
320333
321334test-suite Prelude.WAsync
322335 import: test-options