-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breaking change: Flip default behavior for handling cmake dependencies.
Instead of fetching dependencies by default, we will first look for a local installation and only fetch as a fallback. Two new options are added for forcing either of these behaviors. protobuf_FORCE_FETCH_DEPENDENCIES will always fetch dependencies, and protobuf_PREVENT_FETCH_DEPENDENCIES will never do so. #test-continuous PiperOrigin-RevId: 693898394
- Loading branch information
1 parent
a59cfa4
commit 9cc685e
Showing
9 changed files
with
114 additions
and
111 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 |
---|---|---|
@@ -1,25 +1,28 @@ | ||
option(protobuf_USE_EXTERNAL_GTEST "Use external Google Test (i.e. not the one in third_party/googletest)" OFF) | ||
if (NOT TARGET GTest::gmock) | ||
if (NOT protobuf_FORCE_FETCH_DEPENDENCIES) | ||
find_package(GTest CONFIG) | ||
endif() | ||
|
||
# Fallback to fetching Googletest from github if it's not found locally. | ||
if (NOT GTest_FOUND AND NOT protobuf_LOCAL_DEPENDENCIES_ONLY) | ||
include(${protobuf_SOURCE_DIR}/cmake/dependencies.cmake) | ||
message(STATUS "Fallback to downloading GTest ${googletest-version} from GitHub") | ||
|
||
if (TARGET GTest::gmock) | ||
# GTest is already present. | ||
elseif (protobuf_USE_EXTERNAL_GTEST) | ||
find_package(GTest REQUIRED CONFIG) | ||
else () | ||
if (NOT protobuf_FETCH_DEPENDENCIES) | ||
message(FATAL_ERROR | ||
"Cannot find local googletest directory that's needed to " | ||
"build tests.\n" | ||
"If instead you want to skip tests, run cmake with:\n" | ||
" cmake -Dprotobuf_BUILD_TESTS=OFF\n") | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
googletest | ||
GIT_REPOSITORY "https://github.com/google/googletest.git" | ||
GIT_TAG "v${googletest-version}" | ||
) | ||
# Due to https://github.com/google/googletest/issues/4384, we can't name this | ||
# GTest for use with find_package until 1.15.0. | ||
FetchContent_MakeAvailable(googletest) | ||
endif() | ||
include(${protobuf_SOURCE_DIR}/cmake/dependencies.cmake) | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
googletest | ||
GIT_REPOSITORY "https://github.com/google/googletest.git" | ||
GIT_TAG "v${googletest-version}" | ||
) | ||
# Due to https://github.com/google/googletest/issues/4384, we can't name this | ||
# GTest for use with find_package until 1.15.0. | ||
FetchContent_MakeAvailable(googletest) | ||
endif() | ||
|
||
if (NOT TARGET GTest::gmock) | ||
message(FATAL_ERROR | ||
"Cannot find googletest dependency that's needed to build tests.\n" | ||
"If instead you want to skip tests, run cmake with:\n" | ||
" cmake -Dprotobuf_BUILD_TESTS=OFF\n") | ||
endif() |
17 changes: 0 additions & 17 deletions
17
csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs
This file was deleted.
Oops, something went wrong.
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