mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
cmd/ebitenmobile: Bug fix: Give environment variables to search the package name
This commit is contained in:
parent
c24b43099b
commit
75c9f34374
@ -131,7 +131,22 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func doBind(args []string, flagset *flag.FlagSet) error {
|
func doBind(args []string, flagset *flag.FlagSet) error {
|
||||||
pkgs, err := packages.Load(nil, flagset.Args()[0])
|
tags := buildTags
|
||||||
|
cfg := &packages.Config{}
|
||||||
|
switch buildTarget {
|
||||||
|
case "android":
|
||||||
|
cfg.Env = append(os.Environ(), "GOOS=android")
|
||||||
|
case "ios":
|
||||||
|
cfg.Env = append(os.Environ(), "GOOS=darwin")
|
||||||
|
if tags != "" {
|
||||||
|
tags += " "
|
||||||
|
}
|
||||||
|
tags += "ios"
|
||||||
|
}
|
||||||
|
cfg.BuildFlags = []string{"-tags", tags}
|
||||||
|
cfg.Mode |= packages.NeedName
|
||||||
|
|
||||||
|
pkgs, err := packages.Load(cfg, flagset.Args()[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user