Reputation: 5662
I'm setting up a build system for my Haskell project and would like to build both debug and release versions without modifying the code every time. In other words, I am looking for something similar to GCC's -D flag so that I can have a certain value be False by default and True if that flag is passed to GHC. If the value is True, the app will use the production environment instead of dev.
I could have the environment switch be either on the command-line or test for the presence of a file, but this is not ideal.
What can you guys recommend?
Thanks :-)
Upvotes: 2
Views: 423
Reputation: 16645
C pre-processor macros might get you what you need, especially if you are using cabal as your build system. See this old question
Upvotes: 7