BUILD.bazel 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. load("@io_bazel_rules_go//go:def.bzl", "go_library")
  2. go_library(
  3. name = "go_default_library",
  4. srcs = [
  5. "disk.go",
  6. "disk_darwin.go",
  7. "disk_darwin.h",
  8. "disk_darwin_386.go",
  9. "disk_darwin_amd64.go",
  10. "disk_darwin_arm64.go",
  11. "disk_darwin_cgo.go",
  12. "disk_darwin_nocgo.go",
  13. "disk_fallback.go",
  14. "disk_freebsd.go",
  15. "disk_freebsd_386.go",
  16. "disk_freebsd_amd64.go",
  17. "disk_linux.go",
  18. "disk_openbsd.go",
  19. "disk_openbsd_amd64.go",
  20. "disk_solaris.go",
  21. "disk_unix.go",
  22. "disk_windows.go",
  23. ],
  24. cgo = True,
  25. clinkopts = select({
  26. "@io_bazel_rules_go//go/platform:darwin": [
  27. "-lobjc -framework Foundation -framework IOKit",
  28. ],
  29. "//conditions:default": [],
  30. }),
  31. importmap = "go-common/vendor/github.com/shirou/gopsutil/disk",
  32. importpath = "github.com/shirou/gopsutil/disk",
  33. visibility = ["//visibility:public"],
  34. deps = [
  35. "//vendor/github.com/shirou/gopsutil/internal/common:go_default_library",
  36. ] + select({
  37. "@io_bazel_rules_go//go/platform:darwin": [
  38. "//vendor/golang.org/x/sys/unix:go_default_library",
  39. ],
  40. "@io_bazel_rules_go//go/platform:freebsd": [
  41. "//vendor/golang.org/x/sys/unix:go_default_library",
  42. ],
  43. "@io_bazel_rules_go//go/platform:linux": [
  44. "//vendor/golang.org/x/sys/unix:go_default_library",
  45. ],
  46. "@io_bazel_rules_go//go/platform:openbsd": [
  47. "//vendor/golang.org/x/sys/unix:go_default_library",
  48. ],
  49. "@io_bazel_rules_go//go/platform:solaris": [
  50. "//vendor/golang.org/x/sys/unix:go_default_library",
  51. ],
  52. "@io_bazel_rules_go//go/platform:windows": [
  53. "//vendor/golang.org/x/sys/windows:go_default_library",
  54. ],
  55. "//conditions:default": [],
  56. }),
  57. )
  58. filegroup(
  59. name = "package-srcs",
  60. srcs = glob(["**"]),
  61. tags = ["automanaged"],
  62. visibility = ["//visibility:private"],
  63. )
  64. filegroup(
  65. name = "all-srcs",
  66. srcs = [":package-srcs"],
  67. tags = ["automanaged"],
  68. visibility = ["//visibility:public"],
  69. )