Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unset GMOCK_LIB before find_library to force lookup #726

Merged
merged 2 commits into from
May 5, 2021

Conversation

ThomsonTan
Copy link
Contributor

Changes

find_library is used to get the path of gmock, and build type (CMAKE_BUILD_TYPE) is checked to link to either gmockd.lib for debug build or gmock.lib for others.

The problem is that find_library stores the found library in cache variable which will NOT be re-checked for the CMake re-run, so if the re-run changes build type, it will link to the previous gmock, which causes runtime exception, as the OTLP test and gmock then run with 2 different flavors of CRT library, and trigger exception when passing C++ types around, such as std::string.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@ThomsonTan ThomsonTan requested a review from a team May 5, 2021 06:26
@codecov
Copy link

codecov bot commented May 5, 2021

Codecov Report

Merging #726 (a9ff04d) into main (2d2aa71) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #726   +/-   ##
=======================================
  Coverage   94.76%   94.76%           
=======================================
  Files         217      217           
  Lines        9929     9929           
=======================================
  Hits         9409     9409           
  Misses        520      520           

@lalitb lalitb merged commit 556061a into open-telemetry:main May 5, 2021
@ThomsonTan ThomsonTan deleted the UnsetGMock branch November 9, 2022 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants