[Haskell-cafe] How to set ghc options while building Setup.hs in cabal package?

Daniel Díaz Casanueva dhelta.diaz at gmail.com
Wed Jan 16 09:55:36 UTC 2019


Hi.

I haven't tried myself, but perhaps the OPTIONS_GHC pragma will do what you
want. Just add

{-# OPTIONS_GHC -Wall #-}

to the beginning of your Setup.hs file.

More info:
https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/using.html#source-file-options

I hope that helps.

Best,
Daniel

Am Mi., 16. Jan. 2019, 09:54 hat Magicloud Magiclouds <
magicloud.magiclouds at gmail.com> geschrieben:

> Hi,
>
> I have some code in Setup.hs in a cabalized project. I'd like them to
> be warning-free. But I could not find a way to set -Wall.
>
> I tried ghc-options in ~/.cabal/config. But seems like it did not kick in.
>
> ```
> /bin/ghc --make -fbuilding-cabal-package -odir
>
> /home/shida/src/Personal/cairo-core/dist-newstyle/build/x86_64-linux/ghc-8.6.3/cairo-core-1.16.0/setup
> -hidir
> /home/shida/src/Personal/cairo-core/dist-newstyle/build/x86_64-linux/ghc-8.6.3/cairo-core-1.16.0/setup
> -i -i/home/shida/src/Personal/cairo-core/. -optP-include
>
> -optP/home/shida/src/Personal/cairo-core/dist-newstyle/build/x86_64-linux/ghc-8.6.3/cairo-core-1.16.0/setup/setup_macros.h
> -hide-all-packages -no-user-package-db -package-db
> /home/shida/.cabal/store/ghc-8.6.3/package.db -package-db
> /home/shida/src/Personal/cairo-core/dist-newstyle/packagedb/ghc-8.6.3
> -package-id Cabal-2.4.0.1 -package-id base-4.12.0.0 -package-id
> directory-1.3.3.0 -package-id filepath-1.4.2.1 -package-id
>
> haskell-src-exts-1.21.0-f3e84a9ee8883b0dcaaaaba712d74996854b441aa843a4dedc055c685debcfdb
>
> /home/shida/src/Personal/cairo-core/dist-newstyle/build/x86_64-linux/ghc-8.6.3/cairo-core-1.16.0/setup/setup.hs
> -o
> /home/shida/src/Personal/cairo-core/dist-newstyle/build/x86_64-linux/ghc-8.6.3/cairo-core-1.16.0/setup/setup
> -threaded
> ```
> --
> 竹密岂妨流水过
> 山高哪阻野云飞
>
> And for G+, please use magiclouds#gmail.com.
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20190116/ad7cb502/attachment.html>


More information about the Haskell-Cafe mailing list