-
Notifications
You must be signed in to change notification settings - Fork 3
/
BUILD
128 lines (117 loc) · 2.41 KB
/
BUILD
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package(default_visibility = ["//visibility:public"])
load("@rules_python//python:packaging.bzl", "py_wheel")
SOURCE_FILES_NO_MAIN = glob(
[
"src/**/*.cc",
"src/**/*.h",
"src/**/*.inl",
],
exclude = glob([
"src/**/*.test.cc",
"src/**/*.test.h",
"src/**/*.perf.cc",
"src/**/*.perf.h",
"src/**/*.pybind.cc",
"src/**/*.pybind.h",
"src/**/main.cc",
]),
)
TEST_FILES = glob(
[
"src/**/*.test.cc",
"src/**/*.test.h",
],
)
PERF_FILES = glob(
[
"src/**/*.perf.cc",
"src/**/*.perf.h",
],
)
PYBIND_FILES = glob(
[
"src/**/*.pybind.cc",
"src/**/*.pybind.h",
],
)
cc_binary(
name = "chromobius",
srcs = SOURCE_FILES_NO_MAIN + glob(["src/**/main.cc"]),
copts = [
"-std=c++20",
"-O3",
"-DNDEBUG",
],
includes = ["src/"],
deps = [
"@pymatching//:libpymatching",
"@stim//:stim_lib",
],
)
cc_binary(
name = "chromobius_perf",
srcs = SOURCE_FILES_NO_MAIN + PERF_FILES,
copts = [
"-O3",
"-std=c++20",
"-DNDEBUG",
],
data = glob(["test_data/**"]),
includes = ["src/"],
deps = [
"@pymatching//:libpymatching",
"@stim//:stim_lib",
],
)
cc_test(
name = "chromobius_test",
srcs = SOURCE_FILES_NO_MAIN + TEST_FILES,
copts = [
"-std=c++20",
],
data = glob(["test_data/**"]),
includes = ["src/"],
deps = [
"@gtest",
"@gtest//:gtest_main",
"@pymatching//:libpymatching",
"@stim//:stim_lib",
],
)
cc_binary(
name = "chromobius.so",
srcs = SOURCE_FILES_NO_MAIN + PYBIND_FILES,
copts = [
"-O3",
"-std=c++20",
"-fvisibility=hidden",
"-DNDEBUG",
"-DCHROMOBIUS_VERSION_INFO=0.0.dev0",
],
includes = ["src/"],
linkshared = 1,
deps = [
"@pybind11",
"@pymatching//:libpymatching",
"@stim//:stim_lib",
],
)
genrule(
name = "chromobius_wheel_files",
srcs = ["doc/chromobius.pyi"],
outs = ["chromobius.pyi"],
cmd = "cp $(location doc/chromobius.pyi) $@",
)
py_wheel(
name = "chromobius_dev_wheel",
distribution = "chromobius",
requires = [
"numpy",
"stim",
],
version = "0.0.dev0",
deps = [
":chromobius.so",
":chromobius_wheel_files",
],
)