Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
cc_library(
name = "lightstep_tracer",
srcs = glob([
"src/*.cpp",
"src/*.h",
]),
hdrs = glob(["include/lightstep/*.h"]) + [
":include/lightstep/config.h",
":include/lightstep/version.h",
],
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [
"@com_lightstep_tracer_common//:lightstep_protos",
":3rd_party_base64",
":3rd_party_catch",
# https://github.com/opentracing/opentracing-cpp
"@io_opentracing_cpp//:opentracing",
],
)

genrule(
name = "generate_version_h",
srcs = glob([
"*",
"cmake/**/*",
"example/**/*",
"src/*",
"3rd_party/**/*",
]),
outs = [
"include/lightstep/config.h",
"include/lightstep/version.h",
],
cmd = """
cmake \\
-DBUILD_TESTING=OFF \\
-DWITH_GRPC=OFF \\
-DOPENTRACING_INCLUDE_DIR="" \\
-DOPENTRACING_LIBRARY="" \\
-L \\
$$(dirname $(location :CMakeLists.txt))
mv include/lightstep/config.h $(location :include/lightstep/config.h)
mv include/lightstep/version.h $(location :include/lightstep/version.h)
""",
)

cc_library(
name = "3rd_party_base64",
srcs = glob(["3rd_party/base64/src/*.cpp"]),
hdrs = glob(["3rd_party/base64/include/**/*.h"]),
strip_include_prefix = "3rd_party/base64/include",
)

cc_library(
name = "3rd_party_catch",
hdrs = glob(["3rd_party/catch/include/**/*.hpp"]),
strip_include_prefix = "3rd_party/catch/include",
)
11 changes: 11 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
workspace(name = "com_lightstep_tracer_cpp")

local_repository(
name = "com_lightstep_tracer_common",
path = "lightstep-tracer-common",
)

local_repository(
name = "lightstep_vendored_googleapis",
path = "lightstep-tracer-common/third_party/googleapis",
)
37 changes: 37 additions & 0 deletions lightstep-tracer-common/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
proto_library(
name = "collector_proto",
srcs = ["collector.proto"],
deps = [
"@lightstep_vendored_googleapis//:googleapis_proto",
"@com_google_protobuf//:timestamp_proto",
],
visibility = ["//visibility:public"],
)

cc_proto_library(
name = "collector_proto_cc",
deps = [":collector_proto"],
)

proto_library(
name = "lightstep_carrier_proto",
srcs = ["lightstep_carrier.proto"],
visibility = ["//visibility:public"],
)

cc_proto_library(
name = "lightstep_carrier_proto_cc",
deps = [":lightstep_carrier_proto"],
)

# FIXME: this rule allows `#include <collector.pb.h>` to work, but it
# would be nicer to have properly prefixed include paths instead.
cc_library(
name = "lightstep_protos",
deps = [
":collector_proto_cc",
":lightstep_carrier_proto_cc",
],
visibility = ["//visibility:public"],
includes = ["."]
)
1 change: 1 addition & 0 deletions lightstep-tracer-common/WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

11 changes: 11 additions & 0 deletions lightstep-tracer-common/third_party/googleapis/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
proto_library(
name = "googleapis_proto",
srcs = [
"google/api/annotations.proto",
"google/api/http.proto",
],
deps = [
"@com_google_protobuf//:descriptor_proto",
],
visibility = ["//visibility:public"],
)
Empty file.