From dc288d37f83a3997271d76b8c6a94415a0a3cb85 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 7 Oct 2020 02:20:04 +0900 Subject: [PATCH] Bug fix: Compile error for Wasm --- genkeys.go | 2 ++ internal/glfw/const.go | 2 ++ internal/glfw/generate.go | 2 ++ internal/glfw/glfw_notwindows.go | 1 + internal/glfw/keys.go | 2 ++ internal/glfw/type.go | 2 ++ internal/graphicsdriver/opengl/gl/package.go | 2 ++ 7 files changed, 13 insertions(+) diff --git a/genkeys.go b/genkeys.go index c9c3a0985..9892f29ce 100644 --- a/genkeys.go +++ b/genkeys.go @@ -706,6 +706,8 @@ func main() { // Pass the build tag and extract this in the template to make `go vet` happy. buildTag := "" switch path { + case "internal/glfw/keys.go": + buildTag = "// +build !js" case "internal/uidriver/glfw/keys.go": buildTag = "// +build darwin freebsd linux windows" + "\n// +build !android" + diff --git a/internal/glfw/const.go b/internal/glfw/const.go index e7e26e09c..54099915d 100644 --- a/internal/glfw/const.go +++ b/internal/glfw/const.go @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +// +build !js + package glfw import ( diff --git a/internal/glfw/generate.go b/internal/glfw/generate.go index bff747195..0e51e7cdc 100644 --- a/internal/glfw/generate.go +++ b/internal/glfw/generate.go @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +// +bulid !js + //go:generate sh ./gen.sh package glfw diff --git a/internal/glfw/glfw_notwindows.go b/internal/glfw/glfw_notwindows.go index 1a5a94bb5..4f8f5e810 100644 --- a/internal/glfw/glfw_notwindows.go +++ b/internal/glfw/glfw_notwindows.go @@ -13,6 +13,7 @@ // limitations under the License. // +build !windows +// +build !js package glfw diff --git a/internal/glfw/keys.go b/internal/glfw/keys.go index ac4eb2a3a..89c1d89b9 100644 --- a/internal/glfw/keys.go +++ b/internal/glfw/keys.go @@ -14,6 +14,8 @@ // Code generated by genkeys.go using 'go generate'. DO NOT EDIT. +// +build !js + package glfw const ( diff --git a/internal/glfw/type.go b/internal/glfw/type.go index 9cff47e06..1bf949138 100644 --- a/internal/glfw/type.go +++ b/internal/glfw/type.go @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +// +build !js + package glfw type ( diff --git a/internal/graphicsdriver/opengl/gl/package.go b/internal/graphicsdriver/opengl/gl/package.go index 012a60e2e..9859b8b69 100644 --- a/internal/graphicsdriver/opengl/gl/package.go +++ b/internal/graphicsdriver/opengl/gl/package.go @@ -9,6 +9,8 @@ // This document is licensed under the SGI Free Software B License. // For details, see http://oss.sgi.com/projects/FreeB. +// +build !js + // Package gl implements Go bindings to OpenGL. package gl