about summary refs log tree commit diff
path: root/third_party/bazel/rules_haskell/examples/rts/BUILD.bazel
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/bazel/rules_haskell/examples/rts/BUILD.bazel')
-rw-r--r--third_party/bazel/rules_haskell/examples/rts/BUILD.bazel29
1 files changed, 29 insertions, 0 deletions
diff --git a/third_party/bazel/rules_haskell/examples/rts/BUILD.bazel b/third_party/bazel/rules_haskell/examples/rts/BUILD.bazel
new file mode 100644
index 000000000000..1bbf94b1c0a9
--- /dev/null
+++ b/third_party/bazel/rules_haskell/examples/rts/BUILD.bazel
@@ -0,0 +1,29 @@
+load(
+    "@io_tweag_rules_haskell//haskell:haskell.bzl",
+    "cc_haskell_import",
+    "haskell_library",
+    "haskell_toolchain_library",
+)
+
+haskell_toolchain_library(name = "base")
+
+haskell_library(
+    name = "add-one-hs",
+    srcs = ["One.hs"],
+    deps = [":base"],
+)
+
+cc_haskell_import(
+    name = "add-one-so",
+    dep = ":add-one-hs",
+)
+
+cc_test(
+    name = "add-one",
+    srcs = [
+        "main.c",
+        ":add-one-so",
+    ],
+    visibility = ["//visibility:public"],
+    deps = ["@ghc//:threaded-rts"],
+)