Skip to content

Commit

Permalink
update usage info for Go 1.4+ (useless -data)
Browse files Browse the repository at this point in the history
Because *.c files are not compiled anymore with Go 1.4+ toolchain, the
-data option in current shape has become useless. Usage info is changed
to reflect that.

Note: this could still possibly be done by generating *.s files, but
that'd be much more work. As of now, I don't have plans to do that.
  • Loading branch information
akavel committed Jun 4, 2015
1 parent da35dbf commit a1fbfaf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
16 changes: 4 additions & 12 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,12 @@ rsrc [-manifest FILE.exe.manifest] [-ico FILE.ico[,FILE2.ico...]] -o FILE.syso
Icon embedded this way will show up on application's .exe instead of empty icon.
Manifest file embedded this way will be recognized and detected by Windows.

rsrc -data FILE.dat -o FILE.syso > FILE.c
Generates a .syso file with specified opaque binary blob embedded,
together with related .c file making it possible to access from Go code.
Theoretically cross-platform, but reportedly cannot compile together with cgo.

The generated *.syso and *.c files should get automatically recognized
by 'go build' command and linked into an executable/library, as long as
there are any *.go files in the same directory.

NOTE: starting with Go 1.4+, *.c files reportedly won't be linkable any more,
see: https://codereview.appspot.com/149720043
The generated *.syso files should get automatically recognized by 'go build'
command and linked into an executable/library, as long as there are any *.go
files in the same directory.

OPTIONS:
-data="": path to raw data file to embed
-data="": path to raw data file to embed [WARNING: useless for Go 1.4+]
-ico="": comma-separated list of paths to .ico files to embed
-manifest="": path to a Windows manifest file to embed
-o="rsrc.syso": name of output COFF (.res or .syso) file
Expand Down
15 changes: 5 additions & 10 deletions rsrc.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,9 @@ var usage = `USAGE:
Generates a .syso file with specified resources embedded in .rsrc section,
aimed for consumption by Go linker when building Win32 excecutables.
%s -data FILE.dat -o FILE.syso > FILE.c
Generates a .syso file with specified opaque binary blob embedded,
together with related .c file making it possible to access from Go code.
Theoretically cross-platform, but reportedly cannot compile together with cgo.
The generated *.syso and *.c files should get automatically recognized
by 'go build' command and linked into an executable/library, as long as
there are any *.go files in the same directory.
The generated *.syso files should get automatically recognized by 'go build'
command and linked into an executable/library, as long as there are any *.go
files in the same directory.
OPTIONS:
`
Expand All @@ -61,11 +56,11 @@ func main() {
flags := flag.NewFlagSet("", flag.ContinueOnError)
flags.StringVar(&fnamein, "manifest", "", "path to a Windows manifest file to embed")
flags.StringVar(&fnameico, "ico", "", "comma-separated list of paths to .ico files to embed")
flags.StringVar(&fnamedata, "data", "", "path to raw data file to embed")
flags.StringVar(&fnamedata, "data", "", "path to raw data file to embed [WARNING: useless for Go 1.4+]")
flags.StringVar(&fnameout, "o", "rsrc.syso", "name of output COFF (.res or .syso) file")
_ = flags.Parse(os.Args[1:])
if fnameout == "" || (fnamein == "" && fnamedata == "" && fnameico == "") {
fmt.Fprintf(os.Stderr, usage, os.Args[0], os.Args[0])
fmt.Fprintf(os.Stderr, usage, os.Args[0])
flags.PrintDefaults()
os.Exit(1)
}
Expand Down

0 comments on commit a1fbfaf

Please sign in to comment.