|
@@ -37,6 +37,7 @@ set(gRPC_INSTALL_CMAKEDIR "lib/cmake/${PACKAGE_NAME}" CACHE STRING "Installation
|
|
|
|
|
|
# Options
|
|
|
option(gRPC_BUILD_TESTS "Build tests" OFF)
|
|
|
+option(gRPC_BUILD_CODEGEN "Build codegen" ON)
|
|
|
|
|
|
set(gRPC_INSTALL_default ON)
|
|
|
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
|
@@ -78,6 +79,8 @@ if(UNIX)
|
|
|
set(_gRPC_PLATFORM_LINUX ON)
|
|
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
|
set(_gRPC_PLATFORM_MAC ON)
|
|
|
+ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android")
|
|
|
+ set(_gRPC_PLATFORM_ANDROID ON)
|
|
|
else()
|
|
|
set(_gRPC_PLATFORM_POSIX ON)
|
|
|
endif()
|
|
@@ -120,6 +123,8 @@ endif()
|
|
|
|
|
|
if(_gRPC_PLATFORM_MAC)
|
|
|
set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m pthread)
|
|
|
+elseif(_gRPC_PLATFORM_ANDROID)
|
|
|
+ set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m)
|
|
|
elseif(UNIX)
|
|
|
set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} rt m pthread)
|
|
|
endif()
|
|
@@ -655,9 +660,6 @@ add_library(gpr
|
|
|
src/core/lib/gpr/sync.cc
|
|
|
src/core/lib/gpr/sync_posix.cc
|
|
|
src/core/lib/gpr/sync_windows.cc
|
|
|
- src/core/lib/gpr/thd.cc
|
|
|
- src/core/lib/gpr/thd_posix.cc
|
|
|
- src/core/lib/gpr/thd_windows.cc
|
|
|
src/core/lib/gpr/time.cc
|
|
|
src/core/lib/gpr/time_posix.cc
|
|
|
src/core/lib/gpr/time_precise.cc
|
|
@@ -667,6 +669,8 @@ add_library(gpr
|
|
|
src/core/lib/gpr/tmpfile_posix.cc
|
|
|
src/core/lib/gpr/tmpfile_windows.cc
|
|
|
src/core/lib/gpr/wrap_memcpy.cc
|
|
|
+ src/core/lib/gprpp/thd_posix.cc
|
|
|
+ src/core/lib/gprpp/thd_windows.cc
|
|
|
src/core/lib/profiling/basic_timers.cc
|
|
|
src/core/lib/profiling/stap_timers.cc
|
|
|
)
|
|
@@ -697,6 +701,12 @@ target_include_directories(gpr
|
|
|
target_link_libraries(gpr
|
|
|
${_gRPC_ALLTARGETS_LIBRARIES}
|
|
|
)
|
|
|
+if (_gRPC_PLATFORM_ANDROID)
|
|
|
+ target_link_libraries(gpr
|
|
|
+ android
|
|
|
+ log
|
|
|
+ )
|
|
|
+endif (_gRPC_PLATFORM_ANDROID)
|
|
|
|
|
|
foreach(_hdr
|
|
|
include/grpc/support/alloc.h
|
|
@@ -2713,6 +2723,7 @@ endif()
|
|
|
|
|
|
if (gRPC_BUILD_TESTS)
|
|
|
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
add_library(grpc++_core_stats
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/core/stats.pb.cc
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/core/stats.grpc.pb.cc
|
|
@@ -2758,6 +2769,7 @@ target_link_libraries(grpc++_core_stats
|
|
|
grpc++
|
|
|
)
|
|
|
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
endif (gRPC_BUILD_TESTS)
|
|
|
|
|
@@ -3254,6 +3266,7 @@ if (gRPC_INSTALL)
|
|
|
endif()
|
|
|
|
|
|
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
add_library(grpc++_error_details
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.pb.cc
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.grpc.pb.cc
|
|
@@ -3306,6 +3319,7 @@ foreach(_hdr
|
|
|
DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
|
|
|
)
|
|
|
endforeach()
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
|
|
|
if (gRPC_INSTALL)
|
|
@@ -3318,6 +3332,7 @@ endif()
|
|
|
|
|
|
if (gRPC_BUILD_TESTS)
|
|
|
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
add_library(grpc++_proto_reflection_desc_db
|
|
|
test/cpp/util/proto_reflection_descriptor_database.cc
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.cc
|
|
@@ -3374,9 +3389,11 @@ foreach(_hdr
|
|
|
DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
|
|
|
)
|
|
|
endforeach()
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
endif (gRPC_BUILD_TESTS)
|
|
|
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
add_library(grpc++_reflection
|
|
|
src/cpp/ext/proto_server_reflection.cc
|
|
|
src/cpp/ext/proto_server_reflection_plugin.cc
|
|
@@ -3430,6 +3447,7 @@ foreach(_hdr
|
|
|
DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
|
|
|
)
|
|
|
endforeach()
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
|
|
|
if (gRPC_INSTALL)
|
|
@@ -3483,6 +3501,7 @@ target_link_libraries(grpc++_test_config
|
|
|
endif (gRPC_BUILD_TESTS)
|
|
|
if (gRPC_BUILD_TESTS)
|
|
|
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
add_library(grpc++_test_util
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/health/v1/health.pb.cc
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/health/v1/health.grpc.pb.cc
|
|
@@ -3651,10 +3670,12 @@ foreach(_hdr
|
|
|
DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
|
|
|
)
|
|
|
endforeach()
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
endif (gRPC_BUILD_TESTS)
|
|
|
if (gRPC_BUILD_TESTS)
|
|
|
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
add_library(grpc++_test_util_unsecure
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/health/v1/health.pb.cc
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/health/v1/health.grpc.pb.cc
|
|
@@ -3821,6 +3842,7 @@ foreach(_hdr
|
|
|
DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
|
|
|
)
|
|
|
endforeach()
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
endif (gRPC_BUILD_TESTS)
|
|
|
|
|
@@ -4163,6 +4185,7 @@ target_link_libraries(grpc_benchmark
|
|
|
endif (gRPC_BUILD_TESTS)
|
|
|
if (gRPC_BUILD_TESTS)
|
|
|
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
add_library(grpc_cli_libs
|
|
|
test/cpp/util/cli_call.cc
|
|
|
test/cpp/util/cli_credentials.cc
|
|
@@ -4224,6 +4247,7 @@ foreach(_hdr
|
|
|
DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
|
|
|
)
|
|
|
endforeach()
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
endif (gRPC_BUILD_TESTS)
|
|
|
|
|
@@ -4289,6 +4313,7 @@ endif()
|
|
|
|
|
|
if (gRPC_BUILD_TESTS)
|
|
|
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
add_library(http2_client_main
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/empty.pb.cc
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/empty.grpc.pb.cc
|
|
@@ -4352,10 +4377,12 @@ target_link_libraries(http2_client_main
|
|
|
grpc++_test_config
|
|
|
)
|
|
|
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
endif (gRPC_BUILD_TESTS)
|
|
|
if (gRPC_BUILD_TESTS)
|
|
|
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
add_library(interop_client_helper
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/messages.pb.cc
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/messages.grpc.pb.cc
|
|
@@ -4405,10 +4432,12 @@ target_link_libraries(interop_client_helper
|
|
|
gpr
|
|
|
)
|
|
|
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
endif (gRPC_BUILD_TESTS)
|
|
|
if (gRPC_BUILD_TESTS)
|
|
|
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
add_library(interop_client_main
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/empty.pb.cc
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/empty.grpc.pb.cc
|
|
@@ -4476,6 +4505,7 @@ target_link_libraries(interop_client_main
|
|
|
grpc++_test_config
|
|
|
)
|
|
|
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
endif (gRPC_BUILD_TESTS)
|
|
|
if (gRPC_BUILD_TESTS)
|
|
@@ -4526,6 +4556,7 @@ target_link_libraries(interop_server_helper
|
|
|
endif (gRPC_BUILD_TESTS)
|
|
|
if (gRPC_BUILD_TESTS)
|
|
|
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
add_library(interop_server_lib
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/empty.pb.cc
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/empty.grpc.pb.cc
|
|
@@ -4592,6 +4623,7 @@ target_link_libraries(interop_server_lib
|
|
|
grpc++_test_config
|
|
|
)
|
|
|
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
endif (gRPC_BUILD_TESTS)
|
|
|
if (gRPC_BUILD_TESTS)
|
|
@@ -4638,6 +4670,7 @@ target_link_libraries(interop_server_main
|
|
|
endif (gRPC_BUILD_TESTS)
|
|
|
if (gRPC_BUILD_TESTS)
|
|
|
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
add_library(qps
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/messages.pb.cc
|
|
|
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/messages.grpc.pb.cc
|
|
@@ -4724,6 +4757,7 @@ target_link_libraries(qps
|
|
|
grpc
|
|
|
)
|
|
|
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
endif (gRPC_BUILD_TESTS)
|
|
|
|
|
@@ -6264,7 +6298,7 @@ endif (gRPC_BUILD_TESTS)
|
|
|
if (gRPC_BUILD_TESTS)
|
|
|
|
|
|
add_executable(gpr_thd_test
|
|
|
- test/core/gpr/thd_test.cc
|
|
|
+ test/core/gprpp/thd_test.cc
|
|
|
)
|
|
|
|
|
|
|
|
@@ -10307,6 +10341,7 @@ target_link_libraries(grpc_cli
|
|
|
)
|
|
|
|
|
|
endif (gRPC_BUILD_TESTS)
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
add_executable(grpc_cpp_plugin
|
|
|
src/compiler/cpp_plugin.cc
|
|
@@ -10341,6 +10376,8 @@ if (gRPC_INSTALL)
|
|
|
)
|
|
|
endif()
|
|
|
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
add_executable(grpc_csharp_plugin
|
|
|
src/compiler/csharp_plugin.cc
|
|
@@ -10375,6 +10412,8 @@ if (gRPC_INSTALL)
|
|
|
)
|
|
|
endif()
|
|
|
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
add_executable(grpc_node_plugin
|
|
|
src/compiler/node_plugin.cc
|
|
@@ -10409,6 +10448,8 @@ if (gRPC_INSTALL)
|
|
|
)
|
|
|
endif()
|
|
|
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
add_executable(grpc_objective_c_plugin
|
|
|
src/compiler/objective_c_plugin.cc
|
|
@@ -10443,6 +10484,8 @@ if (gRPC_INSTALL)
|
|
|
)
|
|
|
endif()
|
|
|
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
add_executable(grpc_php_plugin
|
|
|
src/compiler/php_plugin.cc
|
|
@@ -10477,6 +10520,8 @@ if (gRPC_INSTALL)
|
|
|
)
|
|
|
endif()
|
|
|
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
add_executable(grpc_python_plugin
|
|
|
src/compiler/python_plugin.cc
|
|
@@ -10511,6 +10556,8 @@ if (gRPC_INSTALL)
|
|
|
)
|
|
|
endif()
|
|
|
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
+if (gRPC_BUILD_CODEGEN)
|
|
|
|
|
|
add_executable(grpc_ruby_plugin
|
|
|
src/compiler/ruby_plugin.cc
|
|
@@ -10545,6 +10592,7 @@ if (gRPC_INSTALL)
|
|
|
)
|
|
|
endif()
|
|
|
|
|
|
+endif (gRPC_BUILD_CODEGEN)
|
|
|
if (gRPC_BUILD_TESTS)
|
|
|
|
|
|
add_executable(grpc_tool_test
|