aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt49
1 files changed, 49 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 854f72592c..ab4fa8a253 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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()
@@ -695,6 +700,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
@@ -2699,6 +2710,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
@@ -2744,6 +2756,7 @@ target_link_libraries(grpc++_core_stats
grpc++
)
+endif (gRPC_BUILD_CODEGEN)
endif (gRPC_BUILD_TESTS)
@@ -3238,6 +3251,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
@@ -3290,6 +3304,7 @@ foreach(_hdr
DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
)
endforeach()
+endif (gRPC_BUILD_CODEGEN)
if (gRPC_INSTALL)
@@ -3302,6 +3317,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
@@ -3358,9 +3374,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
@@ -3414,6 +3432,7 @@ foreach(_hdr
DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
)
endforeach()
+endif (gRPC_BUILD_CODEGEN)
if (gRPC_INSTALL)
@@ -3467,6 +3486,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
@@ -3635,10 +3655,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
@@ -3805,6 +3827,7 @@ foreach(_hdr
DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
)
endforeach()
+endif (gRPC_BUILD_CODEGEN)
endif (gRPC_BUILD_TESTS)
@@ -4147,6 +4170,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
@@ -4208,6 +4232,7 @@ foreach(_hdr
DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
)
endforeach()
+endif (gRPC_BUILD_CODEGEN)
endif (gRPC_BUILD_TESTS)
@@ -4273,6 +4298,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
@@ -4336,10 +4362,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
@@ -4389,10 +4417,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
@@ -4460,6 +4490,7 @@ target_link_libraries(interop_client_main
grpc++_test_config
)
+endif (gRPC_BUILD_CODEGEN)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
@@ -4510,6 +4541,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
@@ -4576,6 +4608,7 @@ target_link_libraries(interop_server_lib
grpc++_test_config
)
+endif (gRPC_BUILD_CODEGEN)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
@@ -4622,6 +4655,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
@@ -4708,6 +4742,7 @@ target_link_libraries(qps
grpc
)
+endif (gRPC_BUILD_CODEGEN)
endif (gRPC_BUILD_TESTS)
@@ -10264,6 +10299,7 @@ target_link_libraries(grpc_cli
)
endif (gRPC_BUILD_TESTS)
+if (gRPC_BUILD_CODEGEN)
add_executable(grpc_cpp_plugin
src/compiler/cpp_plugin.cc
@@ -10298,6 +10334,8 @@ if (gRPC_INSTALL)
)
endif()
+endif (gRPC_BUILD_CODEGEN)
+if (gRPC_BUILD_CODEGEN)
add_executable(grpc_csharp_plugin
src/compiler/csharp_plugin.cc
@@ -10332,6 +10370,8 @@ if (gRPC_INSTALL)
)
endif()
+endif (gRPC_BUILD_CODEGEN)
+if (gRPC_BUILD_CODEGEN)
add_executable(grpc_node_plugin
src/compiler/node_plugin.cc
@@ -10366,6 +10406,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
@@ -10400,6 +10442,8 @@ if (gRPC_INSTALL)
)
endif()
+endif (gRPC_BUILD_CODEGEN)
+if (gRPC_BUILD_CODEGEN)
add_executable(grpc_php_plugin
src/compiler/php_plugin.cc
@@ -10434,6 +10478,8 @@ if (gRPC_INSTALL)
)
endif()
+endif (gRPC_BUILD_CODEGEN)
+if (gRPC_BUILD_CODEGEN)
add_executable(grpc_python_plugin
src/compiler/python_plugin.cc
@@ -10468,6 +10514,8 @@ if (gRPC_INSTALL)
)
endif()
+endif (gRPC_BUILD_CODEGEN)
+if (gRPC_BUILD_CODEGEN)
add_executable(grpc_ruby_plugin
src/compiler/ruby_plugin.cc
@@ -10502,6 +10550,7 @@ if (gRPC_INSTALL)
)
endif()
+endif (gRPC_BUILD_CODEGEN)
if (gRPC_BUILD_TESTS)
add_executable(grpc_tool_test