mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
fix: cross compiling on linux for windows (#4263)
compile wailsbindings for the build machine Co-authored-by: rynsf <rynsf@users.noreply.github.com> Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
parent
0c24aa4313
commit
ac1479afa2
3 changed files with 6 additions and 10 deletions
|
|
@ -20,8 +20,6 @@ type Options struct {
|
|||
ProjectDirectory string
|
||||
Compiler string
|
||||
GoModTidy bool
|
||||
Platform string
|
||||
Arch string
|
||||
TsPrefix string
|
||||
TsSuffix string
|
||||
TsOutputType string
|
||||
|
|
@ -56,12 +54,11 @@ func GenerateBindings(options Options) (string, error) {
|
|||
}
|
||||
|
||||
envBuild := os.Environ()
|
||||
arch := options.Arch
|
||||
if arch == "universal" {
|
||||
arch = runtime.GOARCH
|
||||
}
|
||||
envBuild = shell.SetEnv(envBuild, "GOOS", options.Platform)
|
||||
envBuild = shell.SetEnv(envBuild, "GOARCH", arch)
|
||||
envBuild = shell.SetEnv(envBuild, "GOOS", runtime.GOOS)
|
||||
envBuild = shell.SetEnv(envBuild, "GOARCH", runtime.GOARCH)
|
||||
// wailsbindings is executed on the build machine.
|
||||
// So, use the default C compiler, not the one set for cross compiling.
|
||||
envBuild = shell.RemoveEnv(envBuild, "CC")
|
||||
|
||||
stdout, stderr, err = shell.RunCommandWithEnv(envBuild, workingDirectory, options.Compiler, "build", "-buildvcs=false", "-tags", tagString, "-o", filename)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -234,8 +234,6 @@ func GenerateBindings(buildOptions *Options) error {
|
|||
Compiler: buildOptions.Compiler,
|
||||
Tags: buildOptions.UserTags,
|
||||
GoModTidy: !buildOptions.SkipModTidy,
|
||||
Platform: buildOptions.Platform,
|
||||
Arch: buildOptions.Arch,
|
||||
TsPrefix: buildOptions.ProjectData.Bindings.TsGeneration.Prefix,
|
||||
TsSuffix: buildOptions.ProjectData.Bindings.TsGeneration.Suffix,
|
||||
TsOutputType: buildOptions.ProjectData.Bindings.TsGeneration.OutputType,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue