Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix definitions for bad_variant_access and dependencies of some examples. #850

Merged
merged 1 commit into from
Jun 12, 2021
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
4 changes: 4 additions & 0 deletions api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ if(WITH_STL)
else()
message("Building with nostd types...")
endif()

if(CORE_RUNTIME_LIBS)
target_link_libraries(opentelemetry_api INTERFACE ${CORE_RUNTIME_LIBS})
endif()
3 changes: 3 additions & 0 deletions api/include/opentelemetry/nostd/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ OPENTELEMETRY_END_NAMESPACE
OPENTELEMETRY_BEGIN_NAMESPACE
namespace nostd
{
# ifdef HAVE_ABSEIL
using absl::bad_variant_access;
# endif
using absl::get;
using absl::get_if;
using absl::holds_alternative;
Expand Down
5 changes: 2 additions & 3 deletions api/test/baggage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ include(GoogleTest)

foreach(testname baggage_test)
add_executable(${testname} "${testname}.cc")
target_link_libraries(
${testname} ${GTEST_BOTH_LIBRARIES} ${CORE_RUNTIME_LIBS}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(
TARGET ${testname}
TEST_PREFIX baggage.
Expand Down
5 changes: 2 additions & 3 deletions api/test/baggage/propagation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
foreach(testname baggage_propagator_test)
add_executable(${testname} "${testname}.cc")
target_link_libraries(
${testname} ${GTEST_BOTH_LIBRARIES} ${CORE_RUNTIME_LIBS}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(
TARGET ${testname}
TEST_PREFIX baggage.
Expand Down
5 changes: 2 additions & 3 deletions api/test/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ include(GoogleTest)

foreach(testname kv_properties_test string_util_test)
add_executable(${testname} "${testname}.cc")
target_link_libraries(
${testname} ${GTEST_BOTH_LIBRARIES} ${CORE_RUNTIME_LIBS}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(
TARGET ${testname}
TEST_PREFIX common.
Expand Down
5 changes: 2 additions & 3 deletions api/test/context/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ include(GoogleTest)

foreach(testname context_test runtime_context_test)
add_executable(${testname} "${testname}.cc")
target_link_libraries(
${testname} ${GTEST_BOTH_LIBRARIES} ${CORE_RUNTIME_LIBS}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(
TARGET ${testname}
TEST_PREFIX context.
Expand Down
5 changes: 2 additions & 3 deletions api/test/context/propagation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
foreach(testname composite_propagator_test)
add_executable(${testname} "${testname}.cc")
target_link_libraries(
${testname} ${GTEST_BOTH_LIBRARIES} ${CORE_RUNTIME_LIBS}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(
TARGET ${testname}
TEST_PREFIX trace.
Expand Down
5 changes: 2 additions & 3 deletions api/test/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
include(GoogleTest)

add_executable(timestamp_test timestamp_test.cc)
target_link_libraries(
timestamp_test ${GTEST_BOTH_LIBRARIES} ${CORE_RUNTIME_LIBS}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(timestamp_test ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(
TARGET timestamp_test
TEST_PREFIX trace.
Expand Down
5 changes: 2 additions & 3 deletions api/test/metrics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
foreach(testname noop_instrument_test meter_provider_test noop_metrics_test)
add_executable(${testname} "${testname}.cc")
target_link_libraries(
${testname} ${GTEST_BOTH_LIBRARIES} ${CORE_RUNTIME_LIBS}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(
TARGET ${testname}
TEST_PREFIX metrics.
Expand Down
5 changes: 2 additions & 3 deletions api/test/nostd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ foreach(
shared_ptr_test
variant_test)
add_executable(${testname} "${testname}.cc")
target_link_libraries(
${testname} ${GTEST_BOTH_LIBRARIES} ${CORE_RUNTIME_LIBS}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(
TARGET ${testname}
TEST_PREFIX nostd.
Expand Down
5 changes: 2 additions & 3 deletions api/test/plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
include(GoogleTest)

add_executable(dynamic_load_test dynamic_load_test.cc)
target_link_libraries(
dynamic_load_test ${GTEST_BOTH_LIBRARIES} ${CORE_RUNTIME_LIBS}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(dynamic_load_test ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(dynamic_load_test ${CMAKE_DL_LIBS})
gtest_add_tests(
TARGET dynamic_load_test
Expand Down
5 changes: 2 additions & 3 deletions api/test/trace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ foreach(
trace_state_test
tracer_test)
add_executable(api_${testname} "${testname}.cc")
target_link_libraries(
api_${testname} ${GTEST_BOTH_LIBRARIES} ${CORE_RUNTIME_LIBS}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(api_${testname} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(
TARGET api_${testname}
TEST_PREFIX trace.
Expand Down
5 changes: 2 additions & 3 deletions api/test/trace/propagation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
foreach(testname http_text_format_test b3_propagation_test
jaeger_propagation_test)
add_executable(${testname} "${testname}.cc")
target_link_libraries(
${testname} ${GTEST_BOTH_LIBRARIES} ${CORE_RUNTIME_LIBS}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(
TARGET ${testname}
TEST_PREFIX trace.
Expand Down
5 changes: 2 additions & 3 deletions examples/batch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include)

add_executable(batch_span_processor_example main.cc)

target_link_libraries(
batch_span_processor_example ${CMAKE_THREAD_LIBS_INIT} ${CORE_RUNTIME_LIBS}
opentelemetry_exporter_ostream_span opentelemetry_trace)
target_link_libraries(batch_span_processor_example ${CMAKE_THREAD_LIBS_INIT}
opentelemetry_exporter_ostream_span opentelemetry_trace)
13 changes: 4 additions & 9 deletions examples/http/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,10 @@ else()
add_executable(http_server server.cc)

target_link_libraries(
http_client
${CMAKE_THREAD_LIBS_INIT}
${CORE_RUNTIME_LIBS}
opentelemetry_trace
http_client_curl
opentelemetry_exporter_ostream_span
${CURL_LIBRARIES})
http_client ${CMAKE_THREAD_LIBS_INIT} opentelemetry_trace http_client_curl
opentelemetry_exporter_ostream_span ${CURL_LIBRARIES})

target_link_libraries(
http_server ${CMAKE_THREAD_LIBS_INIT} ${CORE_RUNTIME_LIBS}
opentelemetry_trace http_client_curl opentelemetry_exporter_ostream_span)
http_server ${CMAKE_THREAD_LIBS_INIT} opentelemetry_trace http_client_curl
opentelemetry_exporter_ostream_span)
endif()
4 changes: 2 additions & 2 deletions examples/jaeger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ include_directories(${CMAKE_SOURCE_DIR}/exporters/jaeger/include)

add_library(jaeger_foo_library foo_library/foo_library.cc)
target_link_libraries(jaeger_foo_library ${CMAKE_THREAD_LIBS_INIT}
${CORE_RUNTIME_LIBS} opentelemetry_api)
opentelemetry_api)

add_executable(example_jaeger main.cc)
target_link_libraries(
example_jaeger ${CMAKE_THREAD_LIBS_INIT} jaeger_foo_library
opentelemetry_trace ${CORE_RUNTIME_LIBS} jaeger_trace_exporter)
opentelemetry_trace jaeger_trace_exporter)
2 changes: 1 addition & 1 deletion examples/metrics_simple/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include)
add_executable(simple_metrics main.cc)
target_link_libraries(
simple_metrics ${CMAKE_THREAD_LIBS_INIT} opentelemetry_metrics
${CORE_RUNTIME_LIBS} opentelemetry_exporter_ostream_metrics)
opentelemetry_exporter_ostream_metrics)
13 changes: 4 additions & 9 deletions examples/otlp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,18 @@ include_directories(${CMAKE_SOURCE_DIR}/exporters/otlp/include)

add_library(otlp_foo_library foo_library/foo_library.cc)
target_link_libraries(otlp_foo_library ${CMAKE_THREAD_LIBS_INIT}
${CORE_RUNTIME_LIBS} opentelemetry_api)
opentelemetry_api)

if(WITH_OTLP_GRPC)
add_executable(example_otlp_grpc grpc_main.cc)
target_link_libraries(
example_otlp_grpc
${CMAKE_THREAD_LIBS_INIT}
otlp_foo_library
opentelemetry_trace
${CORE_RUNTIME_LIBS}
opentelemetry_exporter_otlp_grpc
gRPC::grpc++)
example_otlp_grpc ${CMAKE_THREAD_LIBS_INIT} otlp_foo_library
opentelemetry_trace opentelemetry_exporter_otlp_grpc gRPC::grpc++)
endif()

if(WITH_OTLP_HTTP)
add_executable(example_otlp_http http_main.cc)
target_link_libraries(
example_otlp_http ${CMAKE_THREAD_LIBS_INIT} otlp_foo_library
opentelemetry_trace ${CORE_RUNTIME_LIBS} opentelemetry_exporter_otlp_http)
opentelemetry_trace opentelemetry_exporter_otlp_http)
endif()
2 changes: 1 addition & 1 deletion examples/plugin/load/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
add_executable(load_plugin_example main.cc)
target_link_libraries(load_plugin_example ${CMAKE_DL_LIBS})
target_link_libraries(load_plugin_example opentelemetry_api ${CMAKE_DL_LIBS})
1 change: 1 addition & 0 deletions examples/plugin/plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
add_library(example_plugin SHARED tracer.cc factory_impl.cc)
target_link_libraries(example_plugin opentelemetry_api)
2 changes: 1 addition & 1 deletion sdk/src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set_target_properties(opentelemetry_common PROPERTIES EXPORT_NAME common)

target_link_libraries(
opentelemetry_common PUBLIC opentelemetry_api opentelemetry_sdk
Threads::Threads ${CORE_RUNTIME_LIBS})
Threads::Threads)

install(
TARGETS opentelemetry_common
Expand Down
12 changes: 5 additions & 7 deletions sdk/test/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ foreach(testname
add_executable(${testname} "${testname}.cc")
target_link_libraries(
${testname} ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
${CORE_RUNTIME_LIBS} opentelemetry_common opentelemetry_trace)
opentelemetry_common opentelemetry_trace)

gtest_add_tests(
TARGET ${testname}
Expand All @@ -18,11 +18,9 @@ target_link_libraries(random_fork_test opentelemetry_common)
add_test(random_fork_test random_fork_test)

add_executable(random_benchmark random_benchmark.cc)
target_link_libraries(
random_benchmark benchmark::benchmark ${CORE_RUNTIME_LIBS}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_common)
target_link_libraries(random_benchmark benchmark::benchmark
${CMAKE_THREAD_LIBS_INIT} opentelemetry_common)

add_executable(circular_buffer_benchmark circular_buffer_benchmark.cc)
target_link_libraries(
circular_buffer_benchmark benchmark::benchmark ${CORE_RUNTIME_LIBS}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(circular_buffer_benchmark benchmark::benchmark
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
5 changes: 2 additions & 3 deletions sdk/test/instrumentationlibrary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ include(GoogleTest)

foreach(testname instrumentationlibrary_test)
add_executable(${testname} "${testname}.cc")
target_link_libraries(
${testname} ${GTEST_BOTH_LIBRARIES} ${CORE_RUNTIME_LIBS}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(
TARGET ${testname}
TEST_PREFIX instrumentationlibrary.
Expand Down
10 changes: 2 additions & 8 deletions sdk/test/trace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ foreach(
add_executable(${testname} "${testname}.cc")
target_link_libraries(
${testname}
${CORE_RUNTIME_LIBS}
${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
opentelemetry_common
Expand All @@ -27,10 +26,5 @@ endforeach()

add_executable(sampler_benchmark sampler_benchmark.cc)
target_link_libraries(
sampler_benchmark
benchmark::benchmark
${CMAKE_THREAD_LIBS_INIT}
${CORE_RUNTIME_LIBS}
opentelemetry_trace
opentelemetry_resources
opentelemetry_exporter_in_memory)
sampler_benchmark benchmark::benchmark ${CMAKE_THREAD_LIBS_INIT}
opentelemetry_trace opentelemetry_resources opentelemetry_exporter_in_memory)