mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-18 18:09:30 +08:00
add cross-compile flag to build command
This commit is contained in:
parent
58761ccff4
commit
0f36ee7030
@ -159,6 +159,7 @@ type ProjectOptions struct {
|
||||
WailsVersion string
|
||||
typescriptDefsFilename string
|
||||
Verbose bool `json:"-"`
|
||||
Platform string
|
||||
}
|
||||
|
||||
// Defaults sets the default project template
|
||||
|
@ -15,6 +15,7 @@ func init() {
|
||||
var debugMode = false
|
||||
var typescriptFilename = ""
|
||||
var verbose = false
|
||||
var platform = ""
|
||||
|
||||
buildSpinner := spinner.NewSpinner()
|
||||
buildSpinner.SetSpinSpeed(50)
|
||||
@ -26,7 +27,8 @@ func init() {
|
||||
BoolFlag("f", "Force rebuild of application components", &forceRebuild).
|
||||
BoolFlag("d", "Build in Debug mode", &debugMode).
|
||||
BoolFlag("verbose", "Verbose output", &verbose).
|
||||
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 {
|
||||
|
||||
@ -130,6 +132,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
|
||||
|
Loading…
Reference in New Issue
Block a user