-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBUILD.bazel
59 lines (56 loc) · 2.37 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
package(default_visibility = ["//visibility:public"])
# C++ Slog target exposed to the end users who import slog into their projects.
# Users will see Slog C++ files from `slog_cc/` directory appearing under
# `slog_cc` third-party dir. E.g. `#include <slog_cc/slog.h>` and
# `#include <slog_cc/context/context.h>`
cc_library(
name = "slog_cc",
hdrs = [
# TODO(vsbus): find a right way to add all hdrs here automatically
"//slog_cc/analysis_tools/tracing:slog_trace_subscriber.h",
"//slog_cc/buffer:buffer.h",
"//slog_cc/buffer:buffer_data.h",
"//slog_cc/context:context.h",
"//slog_cc/events:event.h",
"//slog_cc/events:scope.h",
"//slog_cc/primitives:call_site.h",
"//slog_cc/primitives:record.h",
"//slog_cc/primitives:tag.h",
"//slog_cc/primitives:timestamps.h",
"//slog_cc/printer:printer.h",
"//slog_cc:slog.h",
],
copts = [
# max optimizations
"-O3",
],
# We want slog files to be included in a user pjects via
# `#include <slog_cc/foo/bar.h>`. To make it work with bazel we have to do
# a few things:
# * add `includes` parameter: it will add `-isystem path/to/slog_cc` flag
# to a compiler that will make all files under slog_cc/ dir will be
# available to include with angle brackets,
# e.g. `#include <slog_cc/slog.h>`.
# * add `strip_include_prefix` to make files of C++ slog subdir exposed.
# * add `include_prefix` to put all C++ slog include files behind slog_cc
# prefix dir.
# Note: it sounds like using `strip_include_prefix` and `include_prefix`
# with same value doesn't make sense, but if we remove there params user
# project will not be able to see slog .h files for some reason.
include_prefix = "slog_cc",
includes = ["slog_cc"],
strip_include_prefix = "slog_cc",
deps = [
"//slog_cc",
"//slog_cc/analysis_tools/tracing:slog_trace_subscriber",
"//slog_cc/buffer:buffer_cc",
],
)
# Python Slog target exposed to the end users who import slog into their projects.
# Users will see Slog Python files from `slog_py` directory appearing under
# `slog_py` third-party dir. E.g. `from slog_py import slog` and
# `from slog_py.slog_pybind import SlogBuffer, SlogCallSite, SlogRecord`
py_library(
name = "slog_py",
deps = ["//slog_py"],
)