-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breaking change: Migrate to Abseil's logging library.
This deletes our old branches of internal Abseil code in favor of their newly open-sourced library. Notably, this removes the ability to turn CHECK crashes into exceptions. PiperOrigin-RevId: 504460562
- Loading branch information
1 parent
79ee26a
commit a9f1ea6
Showing
234 changed files
with
1,993 additions
and
2,539 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
option(protobuf_USE_EXTERNAL_GTEST "Use external Google Test (i.e. not the one in third_party/googletest)" OFF) | ||
|
||
if (protobuf_USE_EXTERNAL_GTEST) | ||
find_package(GTest REQUIRED) | ||
else() | ||
if (NOT EXISTS "${protobuf_SOURCE_DIR}/third_party/googletest/CMakeLists.txt") | ||
message(FATAL_ERROR | ||
"Cannot find third_party/googletest directory that's needed to " | ||
"build tests. If you use git, make sure you have cloned submodules:\n" | ||
" git submodule update --init --recursive\n" | ||
"If instead you want to skip tests, run cmake with:\n" | ||
" cmake -Dprotobuf_BUILD_TESTS=OFF\n") | ||
endif() | ||
|
||
set(googlemock_source_dir "${protobuf_SOURCE_DIR}/third_party/googletest/googlemock") | ||
set(googletest_source_dir "${protobuf_SOURCE_DIR}/third_party/googletest/googletest") | ||
include_directories( | ||
${googlemock_source_dir} | ||
${googletest_source_dir} | ||
${googletest_source_dir}/include | ||
${googlemock_source_dir}/include | ||
) | ||
|
||
add_library(gmock ${protobuf_SHARED_OR_STATIC} | ||
"${googlemock_source_dir}/src/gmock-all.cc" | ||
"${googletest_source_dir}/src/gtest-all.cc" | ||
) | ||
if (protobuf_BUILD_SHARED_LIBS) | ||
set_target_properties(gmock | ||
PROPERTIES | ||
COMPILE_DEFINITIONS | ||
"GTEST_CREATE_SHARED_LIBRARY=1" | ||
) | ||
install(TARGETS gmock EXPORT protobuf-targets | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
endif() | ||
|
||
target_link_libraries(gmock ${CMAKE_THREAD_LIBS_INIT}) | ||
add_library(gmock_main STATIC "${googlemock_source_dir}/src/gmock_main.cc") | ||
target_link_libraries(gmock_main gmock) | ||
|
||
add_library(GTest::gmock ALIAS gmock) | ||
add_library(GTest::gmock_main ALIAS gmock_main) | ||
add_library(GTest::gtest ALIAS gmock) | ||
add_library(GTest::gtest_main ALIAS gmock_main) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.