diff --git a/BUILD b/BUILD index 4a990e5..1e12348 100644 --- a/BUILD +++ b/BUILD @@ -1,4 +1,4 @@ -load("@rules_go//go:def.bzl", "go_binary", "go_library") +load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_cross_binary") load("@gazelle//:def.bzl", "gazelle") gazelle(name = "gazelle") @@ -16,3 +16,18 @@ go_binary( embed = [":bingbong_lib"], visibility = ["//visibility:public"], ) + +platform( + name = "macos", + constraint_values = [ + "@platforms//os:osx", + "@platforms//cpu:x86_64", + ], +) + +go_cross_binary( + name = "darwin_binary", + platform = ":macos", + sdk_version = "1.21.0", + target = "bingbong", +) diff --git a/MODULE.bazel b/MODULE.bazel index fd99c71..b1e5d00 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -5,7 +5,7 @@ module( bazel_dep(name = "gazelle", version = "0.32.0") bazel_dep(name = "rules_go", version = "0.41.0") -bazel_dep(name = "rules_oci", version = "1.2.0") +bazel_dep(name = "platforms", version = "0.0.7") go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") go_deps.from_file(go_mod = "//:go.mod")