diff --git a/MODULE.bazel b/MODULE.bazel index a9031fc515b77ce825f96284f998dd8ec5ce702a..87d30d38adc7720594ee9fe337f71c1fdcb8aab7 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -71,6 +71,7 @@ compile = use_repo_rule("//ape/compile:repository.bzl", "compile") compile( name = "ape-arm64.macho", srcs = ["@ape-m1.c"], + args = ["-O"], links = { "entrypoint": "binary", }, diff --git a/ape/compile/repository.bzl b/ape/compile/repository.bzl index ea8ce19ddc6dd1365d03d9ab2f887761e6729626..a0590e8db8e2930f8dcc6639af3d6db1fdf82eb0 100644 --- a/ape/compile/repository.bzl +++ b/ape/compile/repository.bzl @@ -33,6 +33,9 @@ ATTRS = { cfg = "exec", default = "@zig", ), + "args": attr.string_list( + doc = "Extra arguments to pass to the compile command.", + ), } def implementation(rctx): @@ -55,6 +58,7 @@ def implementation(rctx): "-o", rctx.attr.output, ] + cmd.extend(rctx.attr.args) cmd.extend(rctx.attr.srcs) rctx.watch(rctx.attr.zig)