[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: TH flag for aeson



On Sun, Jan 08, 2012 at 12:05:13AM +0000, Clint Adams wrote:
> Bryan,
> 
> Would you consider adding a flag like this so that we can build
> modern aeson on architectures without TH?

Also the tests can't be run on platforms without threaded runtime.
In our case, sparc has TH but no RTS.
--- a/aeson.cabal
+++ b/aeson.cabal
@@ -97,6 +97,10 @@
   description: operate in developer mode
   default: False
 
+flag th
+  description: build TH bits
+  default: True
+
 library
   exposed-modules:
     Data.Aeson
@@ -104,7 +108,8 @@
     Data.Aeson.Generic
     Data.Aeson.Parser
     Data.Aeson.Types
-    Data.Aeson.TH
+  if flag(th)
+      exposed-modules: Data.Aeson.TH
 
   other-modules:
     Data.Aeson.Functions
--- a/aeson.cabal
+++ b/aeson.cabal
@@ -101,6 +101,10 @@
   description: build TH bits
   default: True
 
+flag threaded
+  description: build threaded
+  default: True
+
 library
   exposed-modules:
     Data.Aeson
@@ -152,7 +156,9 @@
   main-is:        Properties.hs
 
   ghc-options:
-    -Wall -threaded -rtsopts
+    -Wall -rtsopts
+  if flag(threaded)
+      ghc-options: -threaded
 
   build-depends:
     QuickCheck,

Reply to: