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

半城伤御伤魂 提交于 2020-12-10 13:05:12

问题


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:


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


来源:https://stackoverflow.com/questions/58504153/how-to-build-a-project-with-an-icon-by-cabal-build-or-stack-build

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!