diff --git a/build/srcroot.go b/build/srcroot.go new file mode 100644 index 00000000..6a2958b2 --- /dev/null +++ b/build/srcroot.go @@ -0,0 +1,14 @@ +package blst + +import ( + "path/filepath" + "runtime" +) + +var SrcRoot string + +func init() { + if _, self, _, ok := runtime.Caller(0); ok { + SrcRoot = filepath.Dir(filepath.Dir(self)) + } +}