11package (default_visibility = ["//visibility:public" ])
22
3- load ("@rules_foreign_cc//foreign_cc:defs.bzl" , "cmake" )
3+ load ("@rules_foreign_cc//foreign_cc:defs.bzl" , "cmake" , "configure_make" , "configure_make_variant" )
4+
5+ constraint_setting (
6+ name = "incompatible_setting" ,
7+ )
8+
9+ constraint_value (
10+ name = "incompatible" ,
11+ constraint_setting = ":incompatible_setting" ,
12+ )
13+
14+ config_setting (
15+ name = "windows" ,
16+ constraint_values = [
17+ "@bazel_tools//platforms:windows" ,
18+ ],
19+ tags = ["jaeger" ],
20+ visibility = ["//visibility:private" ],
21+ )
22+
23+ THRIFT_CACHE_ENTRIES = {
24+ "CMAKE_BUILD_TYPE" : "Release" ,
25+ "BUILD_COMPILER" : "OFF" ,
26+ "BUILD_CPP" : "ON" ,
27+ "BUILD_LIBRARIES" : "ON" ,
28+ "BUILD_NODEJS" : "OFF" ,
29+ "BUILD_PYTHON" : "OFF" ,
30+ "BUILD_JAVASCRIPT" : "OFF" ,
31+ "BUILD_C_GLIB" : "OFF" ,
32+ "BUILD_JAVA" : "OFF" ,
33+ "BUILD_TESTING" : "OFF" ,
34+ "BUILD_TUTORIALS" : "OFF" ,
35+ "WITH_HASKELL" : "OFF" ,
36+ }
37+
38+ THRIFT_CACHE_ENTRIES_WIN = {
39+ "CMAKE_BUILD_TYPE" : "Release" ,
40+ "BUILD_COMPILER" : "OFF" ,
41+ "BUILD_CPP" : "ON" ,
42+ "BUILD_LIBRARIES" : "ON" ,
43+ "BUILD_NODEJS" : "OFF" ,
44+ "BUILD_PYTHON" : "OFF" ,
45+ "BUILD_JAVASCRIPT" : "OFF" ,
46+ "BUILD_C_GLIB" : "OFF" ,
47+ "BUILD_JAVA" : "OFF" ,
48+ "BUILD_TESTING" : "OFF" ,
49+ "BUILD_TUTORIALS" : "OFF" ,
50+ "WITH_HASKELL" : "OFF" ,
51+ "WITH_STDTHREADS" : "ON" ,
52+ "WITH_BOOSTTHREADS" : "OFF" ,
53+ "WITH_BOOST_FUNCTIONAL" : "OFF" ,
54+ "WITH_BOOST_SMART_PTR" : "OFF" ,
55+ "BUILD_SHARED_LIBS" : "OFF" ,
56+ "CMAKE_TOOLCHAIN_FILE" : "$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake" ,
57+ }
458
559cmake (
660 name = "thrift" ,
7- cache_entries = {
8- "CMAKE_BUILD_TYPE" : "Release" ,
9- "BUILD_COMPILER" : "OFF" ,
10- "BUILD_CPP" : "ON" ,
11- "BUILD_LIBRARIES" : "ON" ,
12- "BUILD_NODEJS" : "OFF" ,
13- "BUILD_PYTHON" : "OFF" ,
14- "BUILD_JAVASCRIPT" : "OFF" ,
15- "BUILD_C_GLIB" : "OFF" ,
16- "BUILD_JAVA" : "OFF" ,
17- "BUILD_TESTING" : "OFF" ,
18- "BUILD_TUTORIALS" : "OFF" ,
19- "WITH_HASKELL" : "OFF" ,
20- "CMAKE_CXX_FLAGS" : "-fexceptions" ,
21- },
22- lib_source = "@thrift//:all_srcs" ,
23- out_static_libs = [
24- "libthrift.a" ,
25- "libthriftnb.a" ,
26- "libthriftz.a" ,
61+ cache_entries = select ({
62+ "@bazel_tools//platforms:osx" : THRIFT_CACHE_ENTRIES ,
63+ "@bazel_tools//platforms:linux" : THRIFT_CACHE_ENTRIES ,
64+ "@bazel_tools//platforms:windows" : THRIFT_CACHE_ENTRIES_WIN ,
65+ }),
66+ copts = [
67+ "-Ilibs/exporters/jaeger/openssl/include" ,
68+ "-fexceptions" ,
2769 ],
70+ generate_args = select ({
71+ "@bazel_tools//platforms:osx" : [],
72+ "@bazel_tools//platforms:linux" : [],
73+ "@bazel_tools//platforms:windows" : [
74+ "-G \" NMake Makefiles\" " ,
75+ ],
76+ }),
77+ install = True ,
78+ lib_source = "@com_github_thrift//:all_srcs" ,
79+ out_lib_dir = select ({
80+ "@bazel_tools//platforms:osx" : "lib" ,
81+ "@bazel_tools//platforms:linux" : "lib" ,
82+ "@bazel_tools//platforms:windows" : "bin" ,
83+ }),
84+ out_static_libs = select ({
85+ "@bazel_tools//platforms:osx" : [
86+ "libthrift.a" ,
87+ "libthriftz.a" ,
88+ ],
89+ "@bazel_tools//platforms:linux" : [
90+ "libthrift.a" ,
91+ "libthriftz.a" ,
92+ ],
93+ "@bazel_tools//platforms:windows" : [
94+ "thriftmd.lib" ,
95+ ],
96+ }),
2897 tags = ["jaeger" ],
29- target_compatible_with = [
30- "@platforms//os:linux" ,
31- ],
98+ visibility = ["//visibility:private" ],
99+ deps = [],
32100)
33101
102+ THRIFT_GEN_DEPS = [
103+ ":thrift" ,
104+ "//ext/src/http/client/curl:http_client_curl" ,
105+ ]
106+
107+ THRIFT_GEN_DEPS_WIN = THRIFT_GEN_DEPS + [
108+ "@boost_all_hdrs//:boost_all_hdrs" ,
109+ ]
110+
34111cc_library (
35112 name = "jaeger_thrift_gencpp" ,
36113 srcs = [
@@ -50,13 +127,16 @@ cc_library(
50127 "thrift-gen/zipkincore_constants.h" ,
51128 "thrift-gen/zipkincore_types.h" ,
52129 ],
53- copts = ["-fexceptions" ],
130+ copts = [
131+ "-fexceptions" ,
132+ ],
54133 strip_include_prefix = "thrift-gen" ,
55134 tags = ["jaeger" ],
56- deps = [
57- ":thrift" ,
58- "//ext/src/http/client/curl:http_client_curl" ,
59- ],
135+ deps = select ({
136+ "@bazel_tools//platforms:osx" : THRIFT_GEN_DEPS ,
137+ "@bazel_tools//platforms:linux" : THRIFT_GEN_DEPS ,
138+ "@bazel_tools//platforms:windows" : THRIFT_GEN_DEPS_WIN ,
139+ }),
60140)
61141
62142cc_library (
@@ -106,6 +186,7 @@ cc_library(
106186cc_test (
107187 name = "jaeger_recordable_test" ,
108188 srcs = ["test/jaeger_recordable_test.cc" ],
189+ copts = ["-fexceptions" ],
109190 tags = [
110191 "jaeger" ,
111192 "test" ,
0 commit comments