Skip to content

Commit

Permalink
Fix an issue with GMOCK_LIB NOTFOUND with msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgolov authored May 19, 2021
1 parent 976b5ca commit 9ad2f08
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions exporters/otlp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ if(BUILD_TESTING)
TEST_LIST recordable_test)
if(MSVC)
add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1)
endif()
if(GMOCK_LIB)
# unset GMOCK_LIB to force find_library to redo the lookup, as the cached
# entry could cause linking to incorrect flavor of gmock and leading to
# runtime error.
unset(GMOCK_LIB CACHE)
else()
if(GMOCK_LIB)
# unset GMOCK_LIB to force find_library to redo the lookup, as the cached
# entry could cause linking to incorrect flavor of gmock and leading to
# runtime error.
unset(GMOCK_LIB CACHE)
endif()
endif()
if(MSVC AND CMAKE_BUILD_TYPE STREQUAL "Debug")
find_library(GMOCK_LIB gmockd PATH_SUFFIXES lib)
Expand Down

0 comments on commit 9ad2f08

Please sign in to comment.