Skip to content

Commit

Permalink
Merge pull request #280 from james-lawrence/fix-v3.3-vendoring
Browse files Browse the repository at this point in the history
fix: go mod vendor
  • Loading branch information
pwaller authored Apr 20, 2020
2 parents bf0707b + 3161c07 commit 258d9be
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 0 deletions.
18 changes: 18 additions & 0 deletions v3.3/glfw/build_cgo_hack.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// +build required

package glfw

// This file exists purely to prevent the golang toolchain from stripping
// away the c source directories and files when `go mod vendor` is used
// to populate a `vendor/` directory of a project depending on `go-gl/glfw`.
//
// How it works:
// - every directory which only includes c source files receives a dummy.go file.
// - every directory we want to preserve is included here as a _ import.
// - this file is given a build to exclude it from the regular build.
import (
// Prevent go tooling from stripping out the c source files.
_ "github.com/go-gl/glfw/v3.3/glfw/glfw/deps"
_ "github.com/go-gl/glfw/v3.3/glfw/glfw/include/GLFW"
_ "github.com/go-gl/glfw/v3.3/glfw/glfw/src"
)
11 changes: 11 additions & 0 deletions v3.3/glfw/glfw/deps/dummy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// +build required

// Package dummy prevents go tooling from stripping the c dependencies.
package dummy

import (
// Prevent go tooling from stripping out the c source files.
_ "github.com/go-gl/glfw/v3.3/glfw/glfw/deps/glad"
_ "github.com/go-gl/glfw/v3.3/glfw/glfw/deps/mingw"
_ "github.com/go-gl/glfw/v3.3/glfw/glfw/deps/vs2008"
)
4 changes: 4 additions & 0 deletions v3.3/glfw/glfw/deps/glad/dummy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// +build required

// Package dummy prevents go tooling from stripping the c dependencies.
package dummy
4 changes: 4 additions & 0 deletions v3.3/glfw/glfw/deps/mingw/dummy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// +build required

// Package dummy prevents go tooling from stripping the c dependencies.
package dummy
4 changes: 4 additions & 0 deletions v3.3/glfw/glfw/deps/vs2008/dummy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// +build required

// Package dummy prevents go tooling from stripping the c dependencies.
package dummy
4 changes: 4 additions & 0 deletions v3.3/glfw/glfw/include/GLFW/dummy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// +build required

// Package dummy prevents go tooling from stripping the c dependencies.
package dummy
4 changes: 4 additions & 0 deletions v3.3/glfw/glfw/src/dummy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// +build required

// Package dummy prevents go tooling from stripping the c dependencies.
package dummy

0 comments on commit 258d9be

Please sign in to comment.