问题
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 thestack.yaml
file
ghc-options:
"$targets": Icon.o
- for a
cabal
project, add the followingghc-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