Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问是否支持交叉编译、是否能将assets目录下的文件内置到可执行程序中? #6

Open
m3ng9i opened this issue Nov 27, 2021 · 1 comment

Comments

@m3ng9i
Copy link

m3ng9i commented Nov 27, 2021

问题1:请问awtk-go是否支持交叉编译,比如在linux下编译出windows下的可执行程序?

我在linux下执行下面的命令,但是报错了:

GOOS=windows GOARCH=amd64 go build -o button.exe button.go
go build github.com/zlgopen/awtk-go/awtk: build constraints exclude all Go files in /home/xxx/pkg/mod/github.com/zlgopen/[email protected]/awtk

尝试开启cgo,进行交叉编译,仍然报错:

$ CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -o button.exe button.go
# runtime/cgo
gcc: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’?

问题2:用awtk/scripts/release.py发布程序时,会生成一个assets目录,里面是一些资源文件,这些文件能否内置到编译出的可执行程序中呢?如果可以的话,开发好的程序就只有一个可执行程序,没有其他文件了。go本身的embed包可以将文件内置到编译出来的程序中,能否利用embed包的这个功能把assets目录下的资源文件都内置到程序文件中呢?

@xianjimli
Copy link
Member

我对go不熟悉,没法帮你。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants