How to build a project with an icon by `cabal build` or `stack build`

Viewed 140

I want to build an executable with an icon. By googling it, I find the instruction here, but it only works by compiling a source file with ghc.

If I want to build a project with an executable by cabal build or stack build, how should I configure the .cabal or .yaml files such that cabal build or stack build can directly create an executable with an icon?

I've googled it for a while, but nothing useful.

I appreciate it if any tips are given.

1 Answers

According to @Willem Van Onsem's suggestion, the following is the solution:

  • for a stack project, add the following configure into the stack.yaml file
    ghc-options:

        "$targets": Icon.o
  • for a cabal project, add the following ghc-options into the .cabal file
    ghc-options:

        Icon.o
Related