2

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 :-)

Pavel
  • 5,320
  • 8
  • 35
  • 45

1 Answers1

7

C pre-processor macros might get you what you need, especially if you are using cabal as your build system. See this old question

Community
  • 1
  • 1
jberryman
  • 16,334
  • 5
  • 42
  • 83