-
Notifications
You must be signed in to change notification settings - Fork 39
/
BUILD.bazel
63 lines (57 loc) · 1.28 KB
/
BUILD.bazel
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
copts_rel = [
"-fPIC",
# Lto breaks linking on clang-11? Or a bazel bug?
# "-flto=full"
"-fno-exceptions",
"-fno-rtti",
"-fstrict-aliasing",
"-fstrict-enums",
"-fstrict-float-cast-overflow",
"-fstrict-overflow",
"-fstrict-return",
# We want to eagerly adopt optimizations when new compilers roll around
"-Wno-ignored-optimization-argument",
"-Wall",
"-Wextra",
# We can't error-on-warning because bazel does this:
# ld: warning: ignoring duplicate libraries: '-lc++'
# "-Werror",
"-Wpedantic",
"-std=c++20",
"-Iinclude",
# Release flags
"-DNDEBUG",
"-march=native",
"-mtune=native",
"-fexpensive-optimizations",
"-fwhole-program",
"-fomit-frame-pointer",
"-O3",
]
linkopts = select({
"@platforms//os:macos": [
"-framework", "CoreServices",
"-framework", "CoreFoundation",
]
})
cc_library(
name = "watcher-hdr",
hdrs = ["include/wtr/watcher.hpp"],
includes = ["include"],
visibility = ["//visibility:public"],
linkopts = linkopts,
)
cc_binary(
name = "ww",
srcs = ["src/wtr/watcher/main.cpp"],
deps = ["//:watcher-hdr"],
copts = copts_rel,
linkopts = linkopts,
)
cc_binary(
name = "ww-tiny",
srcs = ["src/wtr/tiny_watcher/main.cpp"],
deps = ["//:watcher-hdr"],
copts = copts_rel,
linkopts = linkopts,
)