diff --git a/.gitignore b/.gitignore index 85b0d4e..29c7b18 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ CLAUDE.md # Prebuilt libraries (committed to go branch only) /build-naive /lib/ -/include/ +/include/* +!/include/dummy.go /cgo_*.go /lib_*_cgo.go diff --git a/dummy.go b/dummy.go new file mode 100644 index 0000000..b277ea1 --- /dev/null +++ b/dummy.go @@ -0,0 +1,12 @@ +//go:build dummy + +// This file exists purely to prevent the Go 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 this package. + +package cronet + +import ( + // Prevent go tooling from stripping out the c source files. + _ "github.com/sagernet/cronet-go/include" +) diff --git a/include/dummy.go b/include/dummy.go new file mode 100644 index 0000000..0f014ff --- /dev/null +++ b/include/dummy.go @@ -0,0 +1,2 @@ +// Package include is a dummy package that prevents go tooling from stripping the C dependencies. +package include