Skip to content

Commit 050eac2

Browse files
dmitshurgopherbot
authored andcommitted
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 <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]>
1 parent 38c65eb commit 050eac2

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

shiny/driver/mtldriver/buffer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build darwin
5+
//go:build darwin && cgo
66

77
package mtldriver
88

shiny/driver/mtldriver/mtldriver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build darwin
5+
//go:build darwin && cgo
66

77
// Package mtldriver provides a Metal driver for accessing a screen.
88
//

shiny/driver/mtldriver/screen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build darwin
5+
//go:build darwin && cgo
66

77
package mtldriver
88

shiny/driver/mtldriver/texture.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build darwin
5+
//go:build darwin && cgo
66

77
package mtldriver
88

shiny/driver/mtldriver/window.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build darwin
5+
//go:build darwin && cgo
66

77
package mtldriver
88

0 commit comments

Comments
 (0)