2020-02-12 08:33:48 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2020-08-22 16:16:03 +08:00
|
|
|
index bdadbc9867..f2b1dd774a 100644
|
2020-02-12 08:33:48 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2020-06-24 05:36:26 +08:00
|
|
|
@@ -81,6 +81,9 @@ set_property(CACHE gRPC_SSL_PROVIDER PROPERTY STRINGS "module" "package")
|
|
|
|
set(gRPC_PROTOBUF_PROVIDER "module" CACHE STRING "Provider of protobuf library")
|
|
|
|
set_property(CACHE gRPC_PROTOBUF_PROVIDER PROPERTY STRINGS "module" "package")
|
|
|
|
|
|
|
|
+set(gRPC_UPB_PROVIDER "module" CACHE STRING "Provider of upb library")
|
|
|
|
+set_property(CACHE gRPC_UPB_PROVIDER PROPERTY STRINGS "module" "package")
|
|
|
|
+
|
|
|
|
set(gRPC_PROTOBUF_PACKAGE_TYPE "" CACHE STRING "Algorithm for searching protobuf package")
|
|
|
|
set_property(CACHE gRPC_PROTOBUF_PACKAGE_TYPE PROPERTY STRINGS "CONFIG" "MODULE")
|
|
|
|
|
2020-08-22 16:16:03 +08:00
|
|
|
@@ -1791,7 +1794,6 @@ target_link_libraries(grpc
|
2020-02-12 08:33:48 +08:00
|
|
|
${_gRPC_ALLTARGETS_LIBRARIES}
|
2020-06-24 05:36:26 +08:00
|
|
|
gpr
|
|
|
|
address_sorting
|
|
|
|
- upb
|
|
|
|
absl::optional
|
|
|
|
absl::strings
|
|
|
|
absl::inlined_vector
|
2020-08-22 16:16:03 +08:00
|
|
|
@@ -1870,7 +1872,6 @@ target_link_libraries(grpc_csharp_ext
|
2020-02-12 08:33:48 +08:00
|
|
|
grpc
|
|
|
|
gpr
|
2020-06-24 05:36:26 +08:00
|
|
|
address_sorting
|
2020-02-12 08:33:48 +08:00
|
|
|
- upb
|
|
|
|
)
|
|
|
|
|
2020-06-24 05:36:26 +08:00
|
|
|
|
2020-08-22 16:16:03 +08:00
|
|
|
@@ -2386,7 +2387,6 @@ target_link_libraries(grpc_unsecure
|
2020-02-12 08:33:48 +08:00
|
|
|
${_gRPC_ALLTARGETS_LIBRARIES}
|
|
|
|
gpr
|
2020-06-24 05:36:26 +08:00
|
|
|
address_sorting
|
2020-02-12 08:33:48 +08:00
|
|
|
- upb
|
2020-06-24 05:36:26 +08:00
|
|
|
absl::optional
|
|
|
|
absl::strings
|
|
|
|
absl::inlined_vector
|
2020-08-22 16:16:03 +08:00
|
|
|
@@ -2580,7 +2580,6 @@ target_link_libraries(grpc++
|
2020-06-24 05:36:26 +08:00
|
|
|
grpc
|
2020-02-12 08:33:48 +08:00
|
|
|
gpr
|
2020-06-24 05:36:26 +08:00
|
|
|
address_sorting
|
2020-02-12 08:33:48 +08:00
|
|
|
- upb
|
|
|
|
)
|
2020-06-24 05:36:26 +08:00
|
|
|
|
|
|
|
foreach(_hdr
|
2020-08-22 16:16:03 +08:00
|
|
|
@@ -2856,7 +2855,6 @@ target_link_libraries(grpc++_alts
|
2020-02-12 08:33:48 +08:00
|
|
|
grpc
|
|
|
|
gpr
|
2020-06-24 05:36:26 +08:00
|
|
|
address_sorting
|
2020-02-12 08:33:48 +08:00
|
|
|
- upb
|
|
|
|
)
|
2020-06-24 05:36:26 +08:00
|
|
|
|
|
|
|
foreach(_hdr
|
2020-08-22 16:16:03 +08:00
|
|
|
@@ -2924,7 +2922,6 @@ target_link_libraries(grpc++_error_details
|
2020-06-24 05:36:26 +08:00
|
|
|
grpc
|
2020-02-12 08:33:48 +08:00
|
|
|
gpr
|
2020-06-24 05:36:26 +08:00
|
|
|
address_sorting
|
2020-02-12 08:33:48 +08:00
|
|
|
- upb
|
|
|
|
)
|
2020-06-24 05:36:26 +08:00
|
|
|
|
|
|
|
foreach(_hdr
|
2020-08-22 16:16:03 +08:00
|
|
|
@@ -2997,7 +2994,6 @@ target_link_libraries(grpc++_reflection
|
2020-02-12 08:33:48 +08:00
|
|
|
grpc
|
|
|
|
gpr
|
2020-06-24 05:36:26 +08:00
|
|
|
address_sorting
|
2020-02-12 08:33:48 +08:00
|
|
|
- upb
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach(_hdr
|
2020-08-22 16:16:03 +08:00
|
|
|
@@ -3274,7 +3270,6 @@ target_link_libraries(grpc++_unsecure
|
2020-06-24 05:36:26 +08:00
|
|
|
grpc_unsecure
|
2020-02-12 08:33:48 +08:00
|
|
|
gpr
|
2020-06-24 05:36:26 +08:00
|
|
|
address_sorting
|
2020-02-12 08:33:48 +08:00
|
|
|
- upb
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach(_hdr
|
2020-08-22 16:16:03 +08:00
|
|
|
@@ -3621,7 +3616,6 @@ target_link_libraries(grpcpp_channelz
|
2020-06-24 05:36:26 +08:00
|
|
|
grpc
|
2020-02-12 08:33:48 +08:00
|
|
|
gpr
|
2020-06-24 05:36:26 +08:00
|
|
|
address_sorting
|
2020-02-12 08:33:48 +08:00
|
|
|
- upb
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach(_hdr
|
2020-08-22 16:16:03 +08:00
|
|
|
@@ -3648,6 +3642,7 @@ endif()
|
2020-02-12 08:33:48 +08:00
|
|
|
|
|
|
|
endif()
|
2020-06-24 05:36:26 +08:00
|
|
|
|
|
|
|
+if (gRPC_UPB_PROVIDER STREQUAL "module")
|
2020-02-12 08:33:48 +08:00
|
|
|
add_library(upb
|
|
|
|
third_party/upb/upb/decode.c
|
|
|
|
third_party/upb/upb/encode.c
|
2020-08-22 16:16:03 +08:00
|
|
|
@@ -3697,7 +3692,7 @@ if(gRPC_INSTALL)
|
2020-06-24 05:36:26 +08:00
|
|
|
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
-
|
2020-02-12 08:33:48 +08:00
|
|
|
+endif()
|
|
|
|
|
|
|
|
|
2020-06-24 05:36:26 +08:00
|
|
|
add_executable(check_epollexclusive
|
2020-02-12 08:33:48 +08:00
|
|
|
diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in
|
2020-08-22 16:16:03 +08:00
|
|
|
index 5bfa73c291..db0865ee57 100644
|
2020-02-12 08:33:48 +08:00
|
|
|
--- a/cmake/gRPCConfig.cmake.in
|
|
|
|
+++ b/cmake/gRPCConfig.cmake.in
|
|
|
|
@@ -7,6 +7,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules)
|
|
|
|
@_gRPC_FIND_SSL@
|
|
|
|
@_gRPC_FIND_CARES@
|
|
|
|
@_gRPC_FIND_ABSL@
|
2020-06-24 05:36:26 +08:00
|
|
|
+@_gRPC_FIND_UPB@
|
2020-02-12 08:33:48 +08:00
|
|
|
|
|
|
|
# Targets
|
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake)
|
|
|
|
diff --git a/cmake/upb.cmake b/cmake/upb.cmake
|
2020-08-22 16:16:03 +08:00
|
|
|
index 2c0ab84e67..07dd613a78 100644
|
2020-02-12 08:33:48 +08:00
|
|
|
--- a/cmake/upb.cmake
|
|
|
|
+++ b/cmake/upb.cmake
|
2020-06-24 05:36:26 +08:00
|
|
|
@@ -12,9 +12,18 @@
|
2020-02-12 08:33:48 +08:00
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2020-06-24 05:36:26 +08:00
|
|
|
+set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated")
|
|
|
|
+if (gRPC_UPB_PROVIDER STREQUAL "module")
|
|
|
|
set(UPB_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/upb)
|
2020-02-12 08:33:48 +08:00
|
|
|
|
2020-06-24 05:36:26 +08:00
|
|
|
set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}")
|
|
|
|
-set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated")
|
2020-02-12 08:33:48 +08:00
|
|
|
|
2020-06-24 05:36:26 +08:00
|
|
|
set(_gRPC_UPB_LIBRARIES upb)
|
|
|
|
+
|
|
|
|
+elseif(gRPC_UPB_PROVIDER STREQUAL "package")
|
|
|
|
+ find_package(upb CONFIG REQUIRED)
|
|
|
|
+ set(_gRPC_UPB_LIBRARIES upb::upb)
|
|
|
|
+ set(_gRPC_UPB_INCLUDE_DIR)
|
|
|
|
+ set(upb ${_gRPC_UPB_LIBRARIES})
|
|
|
|
+ set(_gRPC_FIND_UPB "if(NOT upb_FOUND)\n find_package(upb CONFIG REQUIRED)\nendif()")
|
|
|
|
+endif()
|