From ab1ad2c72f7e5065363bb2e3eb382ed5cb9f05a3 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 13 Feb 2022 16:57:48 +0900 Subject: [PATCH] .github/workflow: add a test to build with the build tag ebitencbackend --- .github/workflows/test.yml | 5 +++++ internal/graphicsdriver/opengl/gl/procaddr_notwindows.go | 4 ++-- internal/ui/graphics_opengl.go | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8c7d41e46..1fd7e3a81 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -79,6 +79,11 @@ jobs: env GOOS=windows GOARCH=amd64 go build -tags=example -v ./... env GOOS=windows GOARCH=386 go build -tags=example -v ./... + - name: go build (cbackend) + if: ${{ !startsWith(matrix.os, 'windows-') + run: | + go build -tags=example,ebitencbackend -v ./... + - name: go test (Go 1.16 or older) # TODO: Add more test environments (#1305) if: ${{ startsWith(matrix.os, 'ubuntu-') && (startsWith(matrix.go, '1.15.') || startsWith(matrix.go, '1.16.')) }} diff --git a/internal/graphicsdriver/opengl/gl/procaddr_notwindows.go b/internal/graphicsdriver/opengl/gl/procaddr_notwindows.go index 140c31ee6..068a63ecb 100644 --- a/internal/graphicsdriver/opengl/gl/procaddr_notwindows.go +++ b/internal/graphicsdriver/opengl/gl/procaddr_notwindows.go @@ -24,8 +24,8 @@ package gl #cgo linux,!ebitencbackend freebsd,!ebitencbackend openbsd,!ebitencbackend pkg-config: gl #cgo egl CFLAGS: -DTAG_EGL #cgo egl,!ebitencbackend pkg-config: egl -#cgo !darwin ebitencbackend LDFLAGS: -Wl,-unresolved-symbols=ignore-all -#cgo darwin ebitencbackend LDFLAGS: -Wl,-undefined,dynamic_lookup +#cgo !darwin,ebitencbackend LDFLAGS: -Wl,-unresolved-symbols=ignore-all +#cgo darwin,ebitencbackend LDFLAGS: -Wl,-undefined,dynamic_lookup // Check the EGL tag first as it takes priority over the platform's default // configuration of WGL/GLX/CGL. #if defined(TAG_EGL) diff --git a/internal/ui/graphics_opengl.go b/internal/ui/graphics_opengl.go index 64393bd32..63590ae9a 100644 --- a/internal/ui/graphics_opengl.go +++ b/internal/ui/graphics_opengl.go @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build !darwin || ebitengl -// +build !darwin ebitengl +//go:build !darwin || ebitencbackend || ebitengl +// +build !darwin ebitencbackend ebitengl package ui