From 15523224295824c94f2eddea19d6e5ca079fd715 Mon Sep 17 00:00:00 2001 From: deluan Date: Mon, 23 Feb 2026 20:55:34 -0500 Subject: [PATCH] build: add support for Standard Go in Makefile and update .gitignore --- .gitignore | 3 ++- Makefile | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 949626c..b97dcc4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.wasm *.ndp -tmp \ No newline at end of file +tmp +discord-rich-presence \ No newline at end of file diff --git a/Makefile b/Makefile index 2a74ccb..c6cccc5 100644 --- a/Makefile +++ b/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