mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 14:25:02 +00:00
75 lines
1.7 KiB
Python
75 lines
1.7 KiB
Python
load("//bazel:api.bzl", "modular_py_binary", "modular_run_binary_test")
|
|
|
|
package(default_visibility = ["//visibility:private"])
|
|
|
|
modular_py_binary(
|
|
name = "hello",
|
|
srcs = ["hello.py"],
|
|
data = ["hello_mojo.mojo"],
|
|
imports = ["."],
|
|
mojo_deps = select({
|
|
"//:emit_mojo_enabled": ["//max:MOGGKernelAPI"],
|
|
"//conditions:default": [],
|
|
}),
|
|
target_compatible_with = select({
|
|
"//:asan": ["@platforms//:incompatible"],
|
|
"//:ubsan": ["@platforms//:incompatible"],
|
|
"//conditions:default": [],
|
|
}),
|
|
deps = [
|
|
"@mojo//:python",
|
|
],
|
|
)
|
|
|
|
modular_py_binary(
|
|
name = "person",
|
|
srcs = ["person.py"],
|
|
data = ["person_module.mojo"],
|
|
imports = ["."],
|
|
mojo_deps = select({
|
|
"//:emit_mojo_enabled": ["//max:MOGGKernelAPI"],
|
|
"//conditions:default": [],
|
|
}),
|
|
target_compatible_with = select({
|
|
"//:asan": ["@platforms//:incompatible"],
|
|
"//:ubsan": ["@platforms//:incompatible"],
|
|
"//conditions:default": [],
|
|
}),
|
|
deps = [
|
|
"@mojo//:python",
|
|
],
|
|
)
|
|
|
|
modular_py_binary(
|
|
name = "mandelbrot",
|
|
srcs = ["mandelbrot.py"],
|
|
data = ["mandelbrot_mojo.mojo"],
|
|
imports = ["."],
|
|
mojo_deps = [
|
|
"//max:layout",
|
|
] + select({
|
|
"//:emit_mojo_enabled": ["//max:MOGGKernelAPI"],
|
|
"//conditions:default": [],
|
|
}),
|
|
target_compatible_with = ["//:has_gpu"],
|
|
deps = [
|
|
"@mojo//:python",
|
|
],
|
|
)
|
|
|
|
modular_run_binary_test(
|
|
name = "hello_test",
|
|
binary = "hello",
|
|
)
|
|
|
|
modular_run_binary_test(
|
|
name = "person_test",
|
|
binary = "person",
|
|
)
|
|
|
|
modular_run_binary_test(
|
|
name = "mandelbrot_test",
|
|
binary = "mandelbrot",
|
|
tags = ["gpu"],
|
|
)
|