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
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@ option(WITH_OTPROTOCOL
option(WITH_PROMETHEUS "Whether to include the Prometheus Client in the SDK"
OFF)

option(WITH_TESTS "Whether to enable tests" ON)
option(WITH_EXAMPLES "Whether to build examples" ON)

set(WITH_PROTOBUF OFF)
if(WITH_OTPROTOCOL)
set(WITH_PROTOBUF ON)
endif()

include(CTest)
if(WITH_TESTS)
include(CTest)
endif()

find_package(Threads)

Expand Down Expand Up @@ -58,5 +63,7 @@ include_directories(sdk)
add_subdirectory(sdk)
include_directories(.)
add_subdirectory(exporters)
add_subdirectory(examples)
if(WITH_EXAMPLES)
add_subdirectory(examples)
endif()
add_subdirectory(ext)
28 changes: 15 additions & 13 deletions exporters/memory/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ add_library(opentelemetry_exporter_in_memory INTERFACE)

target_include_directories(opentelemetry_exporter_in_memory INTERFACE include/)

add_executable(in_memory_span_data_test test/in_memory_span_data_test.cc)
add_executable(in_memory_span_exporter_test
test/in_memory_span_exporter_test.cc)
if(BUILD_TESTING)
add_executable(in_memory_span_data_test test/in_memory_span_data_test.cc)
add_executable(in_memory_span_exporter_test
test/in_memory_span_exporter_test.cc)

target_link_libraries(
in_memory_span_data_test ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
opentelemetry_exporter_in_memory)
target_link_libraries(
in_memory_span_data_test ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
opentelemetry_exporter_in_memory)

target_link_libraries(
in_memory_span_exporter_test ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_exporter_in_memory)
target_link_libraries(
in_memory_span_exporter_test ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_exporter_in_memory)

gtest_add_tests(TARGET in_memory_span_data_test TEST_PREFIX exporter. TEST_LIST
in_memory_span_data_test)
gtest_add_tests(TARGET in_memory_span_exporter_test TEST_PREFIX exporter.
TEST_LIST in_memory_span_exporter_test)
gtest_add_tests(TARGET in_memory_span_data_test TEST_PREFIX exporter.
TEST_LIST in_memory_span_data_test)
gtest_add_tests(TARGET in_memory_span_exporter_test TEST_PREFIX exporter.
TEST_LIST in_memory_span_exporter_test)
endif()