googletest icon indicating copy to clipboard operation
googletest copied to clipboard

Add GTEST_HAS_ABSL support into gmock cmake for MSVC

Open matthieugleg opened this issue 1 year ago • 1 comments
trafficstars

Why this change

When building with MSVC, the sources of gtest are included directly in gmock rather than linking to gtest as a separate library. This resulted in GTEST_HAS_ABSL not being defined, causing gmock to miss linking with the necessary Abseil and RE2 libraries.

How this change fix this issue

  • Added conditional compilation definitions for GTEST_HAS_ABSL when building with MSVC.
  • Configured gmock and gmock_main to link with Abseil and RE2 dependencies explicitly.
  • Ensured that the dependencies are linked correctly by defining GTEST_HAS_ABSL and specifying the required libraries, thus resolving build and runtime issues.

matthieugleg avatar Jul 17 '24 12:07 matthieugleg

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Jul 17 '24 12:07 google-cla[bot]