Fix BUILD dependency, copyright and cmake

pull/10586/head
yang-g 8 years ago
parent eceec8eaf6
commit 66d40c63f7
  1. 4
      CMakeLists.txt
  2. 4
      templates/CMakeLists.txt.template
  3. 3
      test/cpp/util/BUILD
  4. 2
      tools/distrib/check_copyright.py

@ -167,6 +167,7 @@ if("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "module")
if(NOT PROTOBUF_ROOT_DIR)
set(PROTOBUF_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/protobuf)
endif()
set(PROTOBUF_WELLKNOWN_IMPORT_DIR ${PROTOBUF_ROOT_DIR}/src)
if(EXISTS "${PROTOBUF_ROOT_DIR}/cmake/CMakeLists.txt")
set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Link static runtime libraries")
add_subdirectory(${PROTOBUF_ROOT_DIR}/cmake third_party/protobuf)
@ -199,6 +200,7 @@ elseif("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "package")
find_package(Protobuf MODULE)
set(_gRPC_FIND_PROTOBUF "if(NOT Protobuf_FOUND)\n find_package(Protobuf)\nendif()")
endif()
set(PROTOBUF_WELLKNOWN_IMPORT_DIR /usr/local/include)
endif()
if("${gRPC_SSL_PROVIDER}" STREQUAL "module")
@ -301,7 +303,7 @@ function(protobuf_generate_grpc_cpp)
return()
endif()
set(_protobuf_include_path -I .)
set(_protobuf_include_path -I . -I ${PROTOBUF_WELLKNOWN_IMPORT_DIR})
foreach(FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)

@ -212,6 +212,7 @@
if(NOT PROTOBUF_ROOT_DIR)
set(PROTOBUF_ROOT_DIR <%text>${CMAKE_CURRENT_SOURCE_DIR}</%text>/third_party/protobuf)
endif()
set(PROTOBUF_WELLKNOWN_IMPORT_DIR <%text>${PROTOBUF_ROOT_DIR}</%text>/src)
if(EXISTS "<%text>${PROTOBUF_ROOT_DIR}</%text>/cmake/CMakeLists.txt")
set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Link static runtime libraries")
add_subdirectory(<%text>${PROTOBUF_ROOT_DIR}</%text>/cmake third_party/protobuf)
@ -244,6 +245,7 @@
find_package(Protobuf MODULE)
set(_gRPC_FIND_PROTOBUF "if(NOT Protobuf_FOUND)\n find_package(Protobuf)\nendif()")
endif()
set(PROTOBUF_WELLKNOWN_IMPORT_DIR /usr/local/include)
endif()
if("<%text>${gRPC_SSL_PROVIDER}</%text>" STREQUAL "module")
@ -346,7 +348,7 @@
return()
endif()
set(_protobuf_include_path -I .)
set(_protobuf_include_path -I . -I <%text>${PROTOBUF_WELLKNOWN_IMPORT_DIR}</%text>)
foreach(FIL <%text>${ARGN}</%text>)
get_filename_component(ABS_FIL <%text>${FIL}</%text> ABSOLUTE)
get_filename_component(FIL_WE <%text>${FIL}</%text> NAME_WE)

@ -89,8 +89,9 @@ cc_test(
"error_details_test.cc",
],
deps = [
"//external:gtest",
"//:grpc++_error_details",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
],
)

@ -113,6 +113,8 @@ _EXEMPT = frozenset((
'src/php/tests/bootstrap.php',
# census.proto copied from github
'tools/grpcz/census.proto',
# status.proto copied from googleapis
'src/proto/grpc/status/status.proto',
))

Loading…
Cancel
Save