mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 23:55:39 +00:00
cmd/gogio: add -tags flag for supplying extra tags to the build
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -203,6 +203,7 @@ func compileAndroid(tmpDir string, tools *androidTools, bi *buildInfo) (err erro
|
||||
"build",
|
||||
"-ldflags=-w -s "+bi.ldflags,
|
||||
"-buildmode=c-shared",
|
||||
"-tags", bi.tags,
|
||||
"-o", libFile,
|
||||
bi.pkg,
|
||||
)
|
||||
|
||||
@@ -34,6 +34,8 @@ and archive. Buildmode exe outputs an .ipa file for iOS or tvOS, an .apk file
|
||||
for Android or a directory with the WebAssembly module and support files for
|
||||
a browser.
|
||||
|
||||
The -ldflags and -tags flags pass extra linker flags and tags to the go tool.
|
||||
|
||||
As a special case for iOS or tvOS, specifying a path that ends with ".app"
|
||||
will output an app directory suitable for a simulator.
|
||||
|
||||
|
||||
@@ -411,7 +411,7 @@ func archiveIOS(tmpDir, target, frameworkRoot string, bi *buildInfo) error {
|
||||
"-ldflags=-s -w "+bi.ldflags,
|
||||
"-buildmode=c-archive",
|
||||
"-o", lib,
|
||||
"-tags", "ios",
|
||||
"-tags", "ios "+bi.tags,
|
||||
bi.pkg,
|
||||
)
|
||||
lipo.Args = append(lipo.Args, lib)
|
||||
|
||||
@@ -22,6 +22,7 @@ func buildJS(bi *buildInfo) error {
|
||||
"go",
|
||||
"build",
|
||||
"-ldflags="+bi.ldflags,
|
||||
"-tags="+bi.tags,
|
||||
"-o", filepath.Join(out, "main.wasm"),
|
||||
bi.pkg,
|
||||
)
|
||||
|
||||
@@ -33,12 +33,14 @@ var (
|
||||
keepWorkdir = flag.Bool("work", false, "print the name of the temporary work directory and do not delete it when exiting.")
|
||||
linkMode = flag.String("linkmode", "", "set the -linkmode flag of the go tool")
|
||||
extraLdflags = flag.String("ldflags", "", "extra flags to the Go linker")
|
||||
extraTags = flag.String("tags", "", "extra tags to the Go tool")
|
||||
)
|
||||
|
||||
type buildInfo struct {
|
||||
name string
|
||||
pkg string
|
||||
ldflags string
|
||||
tags string
|
||||
target string
|
||||
appID string
|
||||
version int
|
||||
@@ -96,6 +98,7 @@ func mainErr() error {
|
||||
dir: dir,
|
||||
version: *version,
|
||||
minsdk: *minsdk,
|
||||
tags: *extraTags,
|
||||
}
|
||||
if bi.appID == "" {
|
||||
bi.appID = appIDFromPackage(pkgPath)
|
||||
|
||||
Reference in New Issue
Block a user