mirror of
https://github.com/taigrr/wails.git
synced 2026-04-12 18:11:31 -07:00
add cross-compile flag to build command
This commit is contained in:
@@ -158,6 +158,7 @@ type ProjectOptions struct {
|
||||
selectedTemplate *TemplateDetails
|
||||
WailsVersion string
|
||||
typescriptDefsFilename string
|
||||
Platform string
|
||||
}
|
||||
|
||||
// Defaults sets the default project template
|
||||
|
||||
@@ -14,6 +14,7 @@ func init() {
|
||||
var forceRebuild = false
|
||||
var debugMode = false
|
||||
var typescriptFilename = ""
|
||||
var platform = ""
|
||||
|
||||
buildSpinner := spinner.NewSpinner()
|
||||
buildSpinner.SetSpinSpeed(50)
|
||||
@@ -24,7 +25,8 @@ func init() {
|
||||
BoolFlag("p", "Package application on successful build", &packageApp).
|
||||
BoolFlag("f", "Force rebuild of application components", &forceRebuild).
|
||||
BoolFlag("d", "Build in Debug mode", &debugMode).
|
||||
StringFlag("t", "Generate Typescript definitions to given file (at runtime)", &typescriptFilename)
|
||||
StringFlag("t", "Generate Typescript definitions to given file (at runtime)", &typescriptFilename).
|
||||
StringFlag("x", "Cross-compile application to specified platform via xgo", &platform)
|
||||
|
||||
initCmd.Action(func() error {
|
||||
|
||||
@@ -127,6 +129,9 @@ func init() {
|
||||
buildSpinner.Success()
|
||||
}
|
||||
|
||||
// Set cross-compile
|
||||
projectOptions.Platform = platform
|
||||
|
||||
err = cmd.BuildApplication(projectOptions.BinaryName, forceRebuild, buildMode, packageApp, projectOptions)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user