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

Add GTEST_HAS_ABSL support into gmock cmake for MSVC #4576

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add GTEST_HAS_ABSL support and dependencies configuration for MSVC
* Added conditional compilation definitions for GTEST_HAS_ABSL in MSVC configuration.
* Configured and linked Abseil and RE2 dependencies when GTEST_HAS_ABSL is enabled.
  • Loading branch information
matthieugleg authored Jul 17, 2024
commit 688a2d93056e7dc80038746bb6947ce9bcbcd3f0
20 changes: 20 additions & 0 deletions googlemock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,26 @@ if (MSVC)
"${gtest_dir}/src/gtest-all.cc"
src/gmock-all.cc
src/gmock_main.cc)

if(GTEST_HAS_ABSL)
target_compile_definitions(gmock PUBLIC GTEST_HAS_ABSL=1)
target_compile_definitions(gmock_main PUBLIC GTEST_HAS_ABSL=1)
set(gmock_DEPENDENCIES
absl::failure_signal_handler
absl::stacktrace
absl::symbolize
absl::flags_parse
absl::flags_reflection
absl::flags_usage
absl::strings
absl::any
absl::optional
absl::variant
re2::re2
)
target_link_libraries(gmock PUBLIC ${gmock_DEPENDENCIES})
target_link_libraries(gmock_main PUBLIC ${gmock_DEPENDENCIES})
endif ()
else()
cxx_library(gmock "${cxx_strict}" src/gmock-all.cc)
target_link_libraries(gmock PUBLIC gtest)
Expand Down