Skip to content

Commit

Permalink
Fix ci.
Browse files Browse the repository at this point in the history
  • Loading branch information
yxue committed Jul 13, 2022
1 parent 90b1a3b commit c1b6f84
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions exporters/memory/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ else()
include(${PROJECT_SOURCE_DIR}/cmake/opentelemetry-proto.cmake)
endif()

add_library(opentelemetry_exporter_in_memory_metric
src/in_memory_metric_exporter.cc)
add_library(
opentelemetry_exporter_in_memory_metric
src/in_memory_metric_exporter.cc ../otlp/src/otlp_metric_utils.cc
../otlp/src/otlp_populate_attribute_utils.cc)

target_include_directories(
opentelemetry_exporter_in_memory_metric
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
"$<INSTALL_INTERFACE:include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../otlp/include>")

set_target_properties(opentelemetry_exporter_in_memory_metric
PROPERTIES EXPORT_NAME in_memory_metric_exporter)
Expand Down Expand Up @@ -89,11 +92,21 @@ if(BUILD_TESTING)
else()
add_executable(in_memory_metric_exporter_test
test/in_memory_metric_exporter_test.cc)

add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1)
if(MSVC)
if(GMOCK_LIB)
unset(GMOCK_LIB CACHE)
endif()
endif()
if(MSVC AND CMAKE_BUILD_TYPE STREQUAL "Debug")
find_library(GMOCK_LIB gmockd PATH_SUFFIXES lib)
else()
find_library(GMOCK_LIB gmock PATH_SUFFIXES lib)
endif()
target_link_libraries(
in_memory_metric_exporter_test ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_exporter_in_memory_metric
opentelemetry_resources)
${CMAKE_THREAD_LIBS_INIT} ${GMOCK_LIB}
opentelemetry_exporter_in_memory_metric opentelemetry_resources)

gtest_add_tests(
TARGET in_memory_metric_exporter_test
Expand Down

0 comments on commit c1b6f84

Please sign in to comment.