Cross-compilation attempts (not successful yet)

This commit is contained in:
Luxferre
2024-09-14 18:21:23 +03:00
parent c0a240d0e9
commit 48dfb9c9f6
5 changed files with 47 additions and 8 deletions
+6 -1
View File
@@ -1,11 +1,16 @@
LDFLAGS = -s -w
LDFLAGS_WIN = -H windowsgui -s -w
GOFLAGS = -trimpath
SOURCES = server.go twitch.go youtube.go
BIN = streamgoose
all: $(SOURCES)
unix:
go mod tidy
go build -o $(BIN) $(GOFLAGS) -ldflags "$(LDFLAGS)" $(SOURCES)
win64:
go mod tidy
GOOS=windows GOARCH=amd64 go build -o $(BIN).exe $(GOFLAGS) -ldflags "$(LDFLAGS_WIN)" $(SOURCES)
clean:
rm $(BIN)
+4 -2
View File
@@ -51,8 +51,10 @@ func appendChatMessages() {
msg.Id = global_msg_id
/* directly call the append function on the JS side */
fmt_str := "gooseAppendMessage('%d', '%s', '%s', '%s', '%s', '%s')"
bro.Eval(fmt.Sprintf(fmt_str, msg.Id, esc(msg.Type), esc(msg.Timestamp), esc(msg.Username), esc(msg.Text), esc(msg.Icon)))
fmt_str := "gooseAppendMessage('%d', '%s', '%s', '%s', '%s', '%s');"
js := fmt.Sprintf(fmt_str, msg.Id, esc(msg.Type), esc(msg.Timestamp), esc(msg.Username), esc(msg.Text), esc(msg.Icon))
log.Printf("Evaluating JS: %s", js)
bro.Eval(js)
}
}