mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
#1265 Support CGO_LDFLAGS
This commit is contained in:
@@ -38,6 +38,8 @@
|
||||
<useCustomBuildTags value="true"/>
|
||||
<envs>
|
||||
<env name="CGO_ENABLED" value=""{{.CGOEnabled}}""/>
|
||||
<env name="CGO_LDFLAGS" value=""{{.CGOLDFlags}}""/>
|
||||
|
||||
</envs>
|
||||
<kind value="DIRECTORY"/>
|
||||
<directory value="$PROJECT_DIR$"/>
|
||||
@@ -50,10 +52,11 @@
|
||||
<module name="{{.ProjectName}}"/>
|
||||
<working_directory value="$PROJECT_DIR$"/>
|
||||
<go_parameters
|
||||
value="-ldflags "{{.WindowsFlags}}" -tags desktop,production,debug -o {{.PathToDesktopBinary}}"/>
|
||||
value="-gcflags "all=-N -l" -ldflags "{{.WindowsFlags}}" -tags desktop,production,debug -o {{.PathToDesktopBinary}}"/>
|
||||
<useCustomBuildTags value="true"/>
|
||||
<envs>
|
||||
<env name="CGO_ENABLED" value=""{{.CGOEnabled}}""/>
|
||||
<env name="CGO_LDFLAGS" value=""{{.CGOLDFlags}}""/>
|
||||
</envs>
|
||||
<kind value="DIRECTORY"/>
|
||||
<directory value="$PROJECT_DIR$"/>
|
||||
@@ -70,6 +73,7 @@
|
||||
<useCustomBuildTags value="true"/>
|
||||
<envs>
|
||||
<env name="CGO_ENABLED" value=""{{.CGOEnabled}}""/>
|
||||
<env name="CGO_LDFLAGS" value=""{{.CGOLDFlags}}""/>
|
||||
</envs>
|
||||
<kind value="DIRECTORY"/>
|
||||
<directory value="$PROJECT_DIR$"/>
|
||||
|
||||
@@ -66,6 +66,7 @@ type Options struct {
|
||||
GoSDKPath string
|
||||
WindowsFlags string
|
||||
CGOEnabled string
|
||||
CGOLDFlags string
|
||||
OutputFile string
|
||||
}
|
||||
|
||||
@@ -409,19 +410,20 @@ func installIDEFiles(o ideOptions) error {
|
||||
}
|
||||
|
||||
binaryName := filepath.Base(o.options.TargetDir)
|
||||
if runtime.GOOS == "windows" {
|
||||
// yay windows
|
||||
o.options.WindowsFlags = ""
|
||||
o.options.CGOEnabled = "1"
|
||||
|
||||
switch runtime.GOOS {
|
||||
case "windows":
|
||||
binaryName += ".exe"
|
||||
o.options.WindowsFlags = " -H windowsgui"
|
||||
o.options.CGOEnabled = "0"
|
||||
case "darwin":
|
||||
o.options.CGOLDFlags = "-framework UniformTypeIdentifiers"
|
||||
}
|
||||
|
||||
o.options.PathToDesktopBinary = filepath.ToSlash(filepath.Join("build", "bin", binaryName))
|
||||
|
||||
o.options.WindowsFlags = ""
|
||||
o.options.CGOEnabled = "1"
|
||||
if runtime.GOOS == "windows" {
|
||||
o.options.WindowsFlags = " -H windowsgui"
|
||||
o.options.CGOEnabled = "0"
|
||||
}
|
||||
err = installer.Extract(o.targetDir, o.options)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user