Skip to content

Commit

Permalink
Fix gmock linking
Browse files Browse the repository at this point in the history
  • Loading branch information
owent committed Oct 18, 2024
1 parent 517dc8b commit c776bc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ext/test/http/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if(WITH_HTTP_CLIENT_CURL)
set(FILENAME curl_http_test)
add_compile_definitions(WITH_CURL)
add_executable(${FILENAME} ${FILENAME}.cc)
target_link_libraries(${FILENAME} ${GTEST_BOTH_LIBRARIES}
target_link_libraries(${FILENAME} ${GMOCK_LIB} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})

if(TARGET CURL::libcurl)
Expand All @@ -24,8 +24,8 @@ endif()

set(URL_PARSER_FILENAME url_parser_test)
add_executable(${URL_PARSER_FILENAME} ${URL_PARSER_FILENAME}.cc)
target_link_libraries(${URL_PARSER_FILENAME} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(${URL_PARSER_FILENAME} opentelemetry_api ${GMOCK_LIB}
${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
gtest_add_tests(
TARGET ${URL_PARSER_FILENAME}
TEST_PREFIX ext.http.urlparser.
Expand Down
5 changes: 3 additions & 2 deletions test_common/src/http/client/nosend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ if(${BUILD_TESTING})
find_library(GMOCK_LIB gmock PATH_SUFFIXES lib)
endif()

target_link_libraries(opentelemetry_http_client_nosend opentelemetry_ext
opentelemetry_test_common ${GTEST_BOTH_LIBRARIES})
target_link_libraries(
opentelemetry_http_client_nosend opentelemetry_ext
opentelemetry_test_common ${GMOCK_LIB} ${GTEST_BOTH_LIBRARIES})

endif()

0 comments on commit c776bc5

Please sign in to comment.