Cabal build depends and if cpp-options

Malcolm Wallace malcolm.wallace at cs.york.ac.uk
Tue Feb 9 11:04:31 EST 2010


> Library
>    Build-depends: base >= 3 && <= 5
>    if (base==4.*)
>        cpp-options: -DUSE_BASE_4
>    else
>        cpp-options: -DUSE_BASE_3
>
>
> Is there a way to use the if construct that check what version of  
> dependent
> package has been chosen?

Flag foo

Library
   if foo
       build-depends: base >=4 && <=5
       cpp-options:   -DUSE_BASE_4
   else
       build-depends: base >=3 && <4
       cpp-options:   -DUSE_BASE_3


Regards,
     Malcolm



More information about the Libraries mailing list