add ebitenginecbackend build tag besides ebitencbackend

Updates #2111
Updates #2190
This commit is contained in:
Hajime Hoshi 2022-07-09 15:19:47 +09:00
parent 204fb5935b
commit 428b1263d9
43 changed files with 88 additions and 84 deletions

View File

@ -101,7 +101,8 @@ jobs:
- name: go build (cbackend) - name: go build (cbackend)
if: ${{ !startsWith(matrix.os, 'windows-') }} if: ${{ !startsWith(matrix.os, 'windows-') }}
run: | run: |
go build -tags=example,ebitencbackend -v ./... go build -tags=example,ebitenginecbackend -v ./...
go build -tags=example,ebitencbackend -v ./... # For backward compatibility. Remove this in the future (#2190).
- name: go test - name: go test
# TODO: Add more test environments (#1305) # TODO: Add more test environments (#1305)

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build ebitencbackend //go:build ebitenginecbackend || ebitencbackend
// +build ebitencbackend // +build ebitenginecbackend ebitencbackend
package cbackend package cbackend

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build ebitencbackend //go:build ebitenginecbackend || ebitencbackend
// +build ebitencbackend // +build ebitenginecbackend ebitencbackend
// TODO: This implementation is very similar to github.com/hajimehoshi/oto/v2's player.go // TODO: This implementation is very similar to github.com/hajimehoshi/oto/v2's player.go
// Unify them if possible. // Unify them if possible.

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !ebitencbackend //go:build !ebitenginecbackend && !ebitencbackend
// +build !ebitencbackend // +build !ebitenginecbackend,!ebitencbackend
package audio package audio

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build ebitencbackend //go:build ebitenginecbackend || ebitencbackend
// +build ebitencbackend // +build ebitenginecbackend ebitencbackend
package audio package audio

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !ebitencbackend //go:build !ebitenginecbackend && !ebitencbackend
// +build !ebitencbackend // +build !ebitenginecbackend,!ebitencbackend
package audio package audio

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !js && !ebitencbackend //go:build !js && !ebitenginecbackend && !ebitencbackend
// +build !js,!ebitencbackend // +build !js,!ebitenginecbackend,!ebitencbackend
package audio package audio

View File

@ -830,12 +830,12 @@ func main() {
buildTag = "//go:build !js" + buildTag = "//go:build !js" +
"\n// +build !js" "\n// +build !js"
case filepath.Join("internal", "ui", "keys_mobile.go"): case filepath.Join("internal", "ui", "keys_mobile.go"):
buildTag = "//go:build (android || ios) && !ebitencbackend" + buildTag = "//go:build (android || ios) && !ebitenginecbackend && !ebitencbackend" +
"\n// +build android ios" + "\n// +build android ios" +
"\n// +build !ebitencbackend" "\n// +build !ebitenginecbackend && !ebitencbackend"
case filepath.Join("internal", "ui", "keys_glfw.go"): case filepath.Join("internal", "ui", "keys_glfw.go"):
buildTag = "//go:build !android && !ios && !js && !ebitencbackend" + buildTag = "//go:build !android && !ios && !js && !ebitenginecbackend && !ebitencbackend" +
"\n// +build !android,!ios,!js,!ebitencbackend" "\n// +build !android,!ios,!js,!ebitenginecbackend && !ebitencbackend"
} }
// NOTE: According to godoc, maps are automatically sorted by key. // NOTE: According to godoc, maps are automatically sorted by key.
if err := tmpl.Execute(f, struct { if err := tmpl.Execute(f, struct {

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build ebitencbackend //go:build ebitenginecbackend || ebitencbackend
// +build ebitencbackend // +build ebitenginecbackend ebitencbackend
package cbackend package cbackend

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !ebitencbackend //go:build !ebitenginecbackend && !ebitencbackend
// +build !ebitencbackend // +build !ebitenginecbackend,!ebitencbackend
package gamepad package gamepad

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build ios && !ebitencbackend //go:build ios && !ebitenginecbackend && !ebitencbackend
// +build ios,!ebitencbackend // +build ios,!ebitenginecbackend,!ebitencbackend
package gamepad package gamepad

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !android && !ebitencbackend //go:build !android && !ebitenginecbackend && !ebitencbackend
// +build !android,!ebitencbackend // +build !android,!ebitenginecbackend,!ebitencbackend
package gamepad package gamepad

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !ebitencbackend //go:build !ebitenginecbackend && !ebitencbackend
// +build !ebitencbackend // +build !ebitenginecbackend,!ebitencbackend
package gamepad package gamepad

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !ebitencbackend //go:build !ebitenginecbackend && !ebitencbackend
// +build !ebitencbackend // +build !ebitenginecbackend,!ebitencbackend
package gamepad package gamepad

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !ebitencbackend //go:build !ebitenginecbackend && !ebitencbackend
// +build !ebitencbackend // +build !ebitenginecbackend,!ebitencbackend
package gamepad package gamepad

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build ebitencbackend //go:build ebitenginecbackend || ebitencbackend
// +build ebitencbackend // +build ebitenginecbackend ebitencbackend
package gamepad package gamepad

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !ios && !ebitencbackend //go:build !ios && !ebitenginecbackend && !ebitencbackend
// +build !ios,!ebitencbackend // +build !ios,!ebitenginecbackend,!ebitencbackend
package gamepad package gamepad

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !ebitencbackend //go:build !ebitenginecbackend && !ebitencbackend
// +build !ebitencbackend // +build !ebitenginecbackend,!ebitencbackend
package gamepad package gamepad

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build ios && !ebitencbackend //go:build ios && !ebitenginecbackend && !ebitencbackend
// +build ios,!ebitencbackend // +build ios,!ebitenginecbackend,!ebitencbackend
package gamepad package gamepad

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !android && !ebitencbackend //go:build !android && !ebitenginecbackend && !ebitencbackend
// +build !android,!ebitencbackend // +build !android,!ebitenginecbackend,!ebitencbackend
package gamepad package gamepad

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !ebitencbackend //go:build !ebitenginecbackend && !ebitencbackend
// +build !ebitencbackend // +build !ebitenginecbackend,!ebitencbackend
package gamepad package gamepad

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !ebitencbackend //go:build !ebitenginecbackend && !ebitencbackend
// +build !ebitencbackend // +build !ebitenginecbackend,!ebitencbackend
package gamepad package gamepad

View File

@ -5,7 +5,7 @@
package gl package gl
// #cgo linux,!ebitencbackend freebsd,!ebitencbackend openbsd,!ebitencbackend pkg-config: gl // #cgo linux,!ebitenginecbackend && !ebitencbackend freebsd,!ebitencbackend openbsd,!ebitencbackend pkg-config: gl
// //
// #ifndef APIENTRY // #ifndef APIENTRY
// #define APIENTRY // #define APIENTRY

View File

@ -19,10 +19,10 @@ package gl
/* /*
#cgo linux freebsd openbsd CFLAGS: -DTAG_POSIX #cgo linux freebsd openbsd CFLAGS: -DTAG_POSIX
#cgo linux,!ebitencbackend freebsd,!ebitencbackend openbsd,!ebitencbackend pkg-config: gl #cgo linux,!ebitenginecbackend && !ebitencbackend freebsd,!ebitencbackend openbsd,!ebitencbackend pkg-config: gl
#cgo egl CFLAGS: -DTAG_EGL #cgo egl CFLAGS: -DTAG_EGL
#cgo egl,!ebitencbackend pkg-config: egl #cgo egl,!ebitenginecbackend && !ebitencbackend pkg-config: egl
#cgo ebitencbackend LDFLAGS: -Wl,-unresolved-symbols=ignore-all #cgo ebitenginecbackend || ebitencbackend LDFLAGS: -Wl,-unresolved-symbols=ignore-all
// Check the EGL tag first as it takes priority over the platform's default // Check the EGL tag first as it takes priority over the platform's default
// configuration of WGL/GLX/CGL. // configuration of WGL/GLX/CGL.
#if defined(TAG_EGL) #if defined(TAG_EGL)

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !windows || ebitencbackend //go:build !windows || ebitenginecbackend || ebitencbackend
// +build !windows ebitencbackend // +build !windows ebitenginecbackend ebitencbackend
package ui package ui

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !ebitencbackend //go:build !ebitenginecbackend && !ebitencbackend
// +build !ebitencbackend // +build !ebitenginecbackend,!ebitencbackend
package ui package ui

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build ebitencbackend //go:build ebitenginecbackend || ebitencbackend
// +build ebitencbackend // +build ebitenginecbackend ebitencbackend
package ui package ui

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !android && !ios && !js && !ebitencbackend //go:build !android && !ios && !js && !ebitenginecbackend && !ebitencbackend
// +build !android,!ios,!js,!ebitencbackend // +build !android,!ios,!js,!ebitenginecbackend,!ebitencbackend
package ui package ui

View File

@ -12,8 +12,9 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build (android || ios) && !ebitencbackend //go:build (android || ios) && !ebitenginecbackend && !ebitencbackend
// +build android ios // +build android ios
// +build !ebitenginecbackend
// +build !ebitencbackend // +build !ebitencbackend
package ui package ui

View File

@ -14,8 +14,8 @@
// Code generated by genkeys.go using 'go generate'. DO NOT EDIT. // Code generated by genkeys.go using 'go generate'. DO NOT EDIT.
//go:build !android && !ios && !js && !ebitencbackend //go:build !android && !ios && !js && !ebitenginecbackend && !ebitencbackend
// +build !android,!ios,!js,!ebitencbackend // +build !android,!ios,!js,!ebitenginecbackend,!ebitencbackend
package ui package ui

View File

@ -14,8 +14,9 @@
// Code generated by genkeys.go using 'go generate'. DO NOT EDIT. // Code generated by genkeys.go using 'go generate'. DO NOT EDIT.
//go:build (android || ios) && !ebitencbackend //go:build (android || ios) && !ebitenginecbackend && !ebitencbackend
// +build android ios // +build android ios
// +build !ebitenginecbackend
// +build !ebitencbackend // +build !ebitencbackend
package ui package ui

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !android && !ios && !js && !ebitencbackend && !ebitensinglethread //go:build !android && !ios && !js && !ebitenginecbackend && !ebitencbackend && !ebitensinglethread
// +build !android,!ios,!js,!ebitencbackend,!ebitensinglethread // +build !android,!ios,!js,!ebitenginecbackend,!ebitencbackend,!ebitensinglethread
package ui package ui

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !android && !ios && !js && !ebitencbackend && ebitensinglethread //go:build !android && !ios && !js && !ebitenginecbackend && !ebitencbackend && ebitensinglethread
// +build !android,!ios,!js,!ebitencbackend,ebitensinglethread // +build !android,!ios,!js,!ebitenginecbackend,!ebitencbackend,ebitensinglethread
package ui package ui

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build ebitencbackend //go:build ebitenginecbackend || ebitencbackend
// +build ebitencbackend // +build ebitenginecbackend ebitencbackend
package ui package ui

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !android && !ios && !js && !ebitencbackend //go:build !android && !ios && !js && !ebitenginecbackend && !ebitencbackend
// +build !android,!ios,!js,!ebitencbackend // +build !android,!ios,!js,!ebitenginecbackend,!ebitencbackend
package ui package ui

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !ios && !ebitencbackend //go:build !ios && !ebitenginecbackend && !ebitencbackend
// +build !ios,!ebitencbackend // +build !ios,!ebitenginecbackend,!ebitencbackend
package ui package ui

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !android && !darwin && !js && !windows && !ebitencbackend //go:build !android && !darwin && !js && !windows && !ebitenginecbackend && !ebitencbackend
// +build !android,!darwin,!js,!windows,!ebitencbackend // +build !android,!darwin,!js,!windows,!ebitenginecbackend,!ebitencbackend
package ui package ui

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !ebitencbackend //go:build !ebitenginecbackend && !ebitencbackend
// +build !ebitencbackend // +build !ebitenginecbackend,!ebitencbackend
package ui package ui

View File

@ -12,8 +12,9 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build (android || ios) && !ebitencbackend //go:build (android || ios) && !ebitenginecbackend && !ebitencbackend
// +build android ios // +build android ios
// +build !ebitenginecbackend
// +build !ebitencbackend // +build !ebitencbackend
package ui package ui

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !android && !ios && !js && !ebitencbackend //go:build !android && !ios && !js && !ebitenginecbackend && !ebitencbackend
// +build !android,!ios,!js,!ebitencbackend // +build !android,!ios,!js,!ebitenginecbackend,!ebitencbackend
package ui package ui

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build !ebitencbackend //go:build !ebitenginecbackend && !ebitencbackend
// +build !ebitencbackend // +build !ebitenginecbackend,!ebitencbackend
package vibrate package vibrate

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build ios && !ebitencbackend //go:build ios && !ebitenginecbackend && !ebitencbackend
// +build ios,!ebitencbackend // +build ios,!ebitenginecbackend,!ebitencbackend
package vibrate package vibrate

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//go:build (!android && !ios && !js) || ebitencbackend //go:build (!android && !ios && !js) || ebitenginecbackend || ebitencbackend
// +build !android,!ios,!js ebitencbackend // +build !android,!ios,!js ebitenginecbackend ebitencbackend
package vibrate package vibrate