-
Notifications
You must be signed in to change notification settings - Fork 0
/
deps.bzl
31 lines (24 loc) · 1002 Bytes
/
deps.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
load("@rules_haskell//haskell:defs.bzl", "haskell_binary")
load("@rules_rust//rust:defs.bzl", "rust_binary")
PACKAGES = ["array", "base", "text", "containers", "split", "parallel", "extra", "directory", "unix",
"attoparsec", "random"]
STACKAGE_DEPS = ["@stackage//{}".format(it) for it in PACKAGES]
EXTENSIONS = ["-XOverloadedStrings", "-XTupleSections"]
GHCOPTS = ["-threaded", "-rtsopts", "-O2"] + EXTENSIONS
def aoc(day):
haskell_binary(
name = "d{}".format(day),
srcs = ["Day{}.hs".format(day)],
deps = ["@//:aoclib"] + STACKAGE_DEPS,
data = native.glob(["{}/*.txt".format(day)]),
ghcopts = select({
"//:profiling": GHCOPTS + ["-prof", "-fprof-late"],
"//conditions:default": GHCOPTS,
})
)
rust_binary(
name = "r{}".format(day),
srcs = ["day_{}.rs".format(day)],
deps = ["@crate_index//:nom", "@//:aoclib-rs"],
data = native.glob(["{}/*.txt".format(day)]),
)