shiny/driver/mtldriver: add cgo build constraint

The mtldriver package requires cgo even though it itself doesn't import
"C" directly. This is because it imports Go packages that require cgo.

So, add the 'cgo' build constraint to mtldriver too, since it can't do
its job without it.

This fixes 'build constraints exclude all Go files' build errors when
CGO_ENABLED is set to 0. Uncovered incidentally while cross-compiling
to another platform, which happens to disable cgo by default.

For golang/go#61698.

Change-Id: I298018e79a5e93a55d39bda2b253686cde8b5e8a
Reviewed-on: https://go-review.googlesource.com/c/exp/+/516677
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/shiny/driver/mtldriver/buffer.go b/shiny/driver/mtldriver/buffer.go
index ef13fae..fdd775a 100644
--- a/shiny/driver/mtldriver/buffer.go
+++ b/shiny/driver/mtldriver/buffer.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build darwin
+//go:build darwin && cgo
 
 package mtldriver
 
diff --git a/shiny/driver/mtldriver/mtldriver.go b/shiny/driver/mtldriver/mtldriver.go
index 3f5c36c..b705be1 100644
--- a/shiny/driver/mtldriver/mtldriver.go
+++ b/shiny/driver/mtldriver/mtldriver.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build darwin
+//go:build darwin && cgo
 
 // Package mtldriver provides a Metal driver for accessing a screen.
 //
diff --git a/shiny/driver/mtldriver/screen.go b/shiny/driver/mtldriver/screen.go
index 71cbabc..df6155c 100644
--- a/shiny/driver/mtldriver/screen.go
+++ b/shiny/driver/mtldriver/screen.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build darwin
+//go:build darwin && cgo
 
 package mtldriver
 
diff --git a/shiny/driver/mtldriver/texture.go b/shiny/driver/mtldriver/texture.go
index f0a801f..a0277bb 100644
--- a/shiny/driver/mtldriver/texture.go
+++ b/shiny/driver/mtldriver/texture.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build darwin
+//go:build darwin && cgo
 
 package mtldriver
 
diff --git a/shiny/driver/mtldriver/window.go b/shiny/driver/mtldriver/window.go
index b21a8a8..078a951 100644
--- a/shiny/driver/mtldriver/window.go
+++ b/shiny/driver/mtldriver/window.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build darwin
+//go:build darwin && cgo
 
 package mtldriver