diff --git a/ext/test/http/CMakeLists.txt b/ext/test/http/CMakeLists.txt index 328f78638b..9f5514d07b 100644 --- a/ext/test/http/CMakeLists.txt +++ b/ext/test/http/CMakeLists.txt @@ -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) @@ -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. diff --git a/test_common/src/http/client/nosend/CMakeLists.txt b/test_common/src/http/client/nosend/CMakeLists.txt index 92a2c1f98c..7394053a22 100644 --- a/test_common/src/http/client/nosend/CMakeLists.txt +++ b/test_common/src/http/client/nosend/CMakeLists.txt @@ -28,7 +28,7 @@ if(${BUILD_TESTING}) endif() target_link_libraries( - opentelemetry_http_client_nosend ${GTEST_BOTH_LIBRARIES} opentelemetry_ext - opentelemetry_test_common) + opentelemetry_http_client_nosend opentelemetry_ext + opentelemetry_test_common ${GMOCK_LIB} ${GTEST_BOTH_LIBRARIES}) endif()