From 683e0c98c4c83b5c7447a86ddf4972fb0163e531 Mon Sep 17 00:00:00 2001 From: hololeap Date: Fri, 28 Oct 2022 08:26:06 -0600 Subject: [PATCH] Add `smp` flag This flag will toggle the use of some `ghc-options` in the `typed-process-test` test suite. It is set to `default: True`. This is needed for tests to run on some GHC builds which do not support a threaded runtime. Signed-off-by: hololeap --- package.yaml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/package.yaml b/package.yaml index 8fca99f..8bd8c53 100644 --- a/package.yaml +++ b/package.yaml @@ -22,6 +22,12 @@ dependencies: - transformers - unliftio-core +flags: + smp: + description: Use flags that depend on GHC supporting a multicore runtime (tests only) + default: True + manual: True + library: source-dirs: src when: @@ -32,10 +38,16 @@ tests: typed-process-test: main: Spec.hs source-dirs: test - ghc-options: - - -threaded - - -rtsopts - - -with-rtsopts=-N + when: + - condition: flag(smp) + then: + ghc-options: + - -threaded + - -rtsopts + - -with-rtsopts=-N + else: + ghc-options: + - -threaded dependencies: - base64-bytestring - hspec