-
Notifications
You must be signed in to change notification settings - Fork 1
/
BUILD
38 lines (31 loc) · 880 Bytes
/
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
load("@rules_license//rules:license.bzl", "license")
package(
default_applicable_licenses = [":license"],
default_visibility = ["//visibility:public"],
)
license(name = "license")
licenses(["notice"])
exports_files(["LICENSE"])
cc_library(
name = "proto",
hdrs = ["proto.h"],
)
# This can also be used by linking to this library, instead of using LD_PRELOAD with the target below.
cc_library(
name = "pthread_trace",
srcs = [
"pthread_trace.cc",
"perfetto.h",
],
deps = [":proto"],
alwayslink = 1,
linkopts = ["-ldl", "-lpthread", "-lc"],
)
# This can also be compiled easily without bazel:
# c++ -shared -fPIC -ldl -O2 -DNDEBUG -std=c++14 pthread_trace.cc -o pthread_trace.so
cc_binary(
name = "pthread_trace.so",
deps = [":pthread_trace"],
visibility = ["//visibility:public"],
linkshared = True,
)