build: add support for Standard Go in Makefile and update .gitignore
This commit is contained in:
6
Makefile
6
Makefile
@@ -3,12 +3,18 @@ SHELL := /usr/bin/env bash
|
||||
|
||||
PLUGIN_NAME := discord-rich-presence
|
||||
WASM_FILE := plugin.wasm
|
||||
TINYGO := $(shell command -v tinygo 2> /dev/null)
|
||||
|
||||
test:
|
||||
go test -race ./...
|
||||
|
||||
build:
|
||||
ifdef TINYGO
|
||||
tinygo build -opt=2 -scheduler=none -no-debug -o $(WASM_FILE) -target wasi -buildmode=c-shared .
|
||||
else
|
||||
GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared -o $(WASM_FILE) .
|
||||
endif
|
||||
|
||||
|
||||
package: build
|
||||
zip $(PLUGIN_NAME).ndp $(WASM_FILE) manifest.json
|
||||
|
||||
Reference in New Issue
Block a user