|  | @@ -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()
 | 
	
	
		
			
				|  | @@ -696,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
 | 
	
	
		
			
				|  | @@ -2700,6 +2711,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
 | 
	
	
		
			
				|  | @@ -2745,6 +2757,7 @@ target_link_libraries(grpc++_core_stats
 | 
	
		
			
				|  |  |    grpc++
 | 
	
		
			
				|  |  |  )
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +endif (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  endif (gRPC_BUILD_TESTS)
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -3239,6 +3252,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
 | 
	
	
		
			
				|  | @@ -3291,6 +3305,7 @@ foreach(_hdr
 | 
	
		
			
				|  |  |      DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
 | 
	
		
			
				|  |  |    )
 | 
	
		
			
				|  |  |  endforeach()
 | 
	
		
			
				|  |  | +endif (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  if (gRPC_INSTALL)
 | 
	
	
		
			
				|  | @@ -3303,6 +3318,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
 | 
	
	
		
			
				|  | @@ -3359,9 +3375,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
 | 
	
	
		
			
				|  | @@ -3415,6 +3433,7 @@ foreach(_hdr
 | 
	
		
			
				|  |  |      DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
 | 
	
		
			
				|  |  |    )
 | 
	
		
			
				|  |  |  endforeach()
 | 
	
		
			
				|  |  | +endif (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  if (gRPC_INSTALL)
 | 
	
	
		
			
				|  | @@ -3468,6 +3487,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
 | 
	
	
		
			
				|  | @@ -3636,10 +3656,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
 | 
	
	
		
			
				|  | @@ -3806,6 +3828,7 @@ foreach(_hdr
 | 
	
		
			
				|  |  |      DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
 | 
	
		
			
				|  |  |    )
 | 
	
		
			
				|  |  |  endforeach()
 | 
	
		
			
				|  |  | +endif (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  endif (gRPC_BUILD_TESTS)
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -4148,6 +4171,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
 | 
	
	
		
			
				|  | @@ -4209,6 +4233,7 @@ foreach(_hdr
 | 
	
		
			
				|  |  |      DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
 | 
	
		
			
				|  |  |    )
 | 
	
		
			
				|  |  |  endforeach()
 | 
	
		
			
				|  |  | +endif (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  endif (gRPC_BUILD_TESTS)
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -4274,6 +4299,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
 | 
	
	
		
			
				|  | @@ -4337,10 +4363,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
 | 
	
	
		
			
				|  | @@ -4390,10 +4418,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
 | 
	
	
		
			
				|  | @@ -4461,6 +4491,7 @@ target_link_libraries(interop_client_main
 | 
	
		
			
				|  |  |    grpc++_test_config
 | 
	
		
			
				|  |  |  )
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +endif (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  endif (gRPC_BUILD_TESTS)
 | 
	
		
			
				|  |  |  if (gRPC_BUILD_TESTS)
 | 
	
	
		
			
				|  | @@ -4511,6 +4542,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
 | 
	
	
		
			
				|  | @@ -4577,6 +4609,7 @@ target_link_libraries(interop_server_lib
 | 
	
		
			
				|  |  |    grpc++_test_config
 | 
	
		
			
				|  |  |  )
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +endif (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  endif (gRPC_BUILD_TESTS)
 | 
	
		
			
				|  |  |  if (gRPC_BUILD_TESTS)
 | 
	
	
		
			
				|  | @@ -4623,6 +4656,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
 | 
	
	
		
			
				|  | @@ -4709,6 +4743,7 @@ target_link_libraries(qps
 | 
	
		
			
				|  |  |    grpc
 | 
	
		
			
				|  |  |  )
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +endif (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  endif (gRPC_BUILD_TESTS)
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -10265,6 +10300,7 @@ target_link_libraries(grpc_cli
 | 
	
		
			
				|  |  |  )
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  endif (gRPC_BUILD_TESTS)
 | 
	
		
			
				|  |  | +if (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  add_executable(grpc_cpp_plugin
 | 
	
		
			
				|  |  |    src/compiler/cpp_plugin.cc
 | 
	
	
		
			
				|  | @@ -10299,6 +10335,8 @@ if (gRPC_INSTALL)
 | 
	
		
			
				|  |  |    )
 | 
	
		
			
				|  |  |  endif()
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +endif (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  | +if (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  add_executable(grpc_csharp_plugin
 | 
	
		
			
				|  |  |    src/compiler/csharp_plugin.cc
 | 
	
	
		
			
				|  | @@ -10333,6 +10371,8 @@ if (gRPC_INSTALL)
 | 
	
		
			
				|  |  |    )
 | 
	
		
			
				|  |  |  endif()
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +endif (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  | +if (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  add_executable(grpc_node_plugin
 | 
	
		
			
				|  |  |    src/compiler/node_plugin.cc
 | 
	
	
		
			
				|  | @@ -10367,6 +10407,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
 | 
	
	
		
			
				|  | @@ -10401,6 +10443,8 @@ if (gRPC_INSTALL)
 | 
	
		
			
				|  |  |    )
 | 
	
		
			
				|  |  |  endif()
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +endif (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  | +if (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  add_executable(grpc_php_plugin
 | 
	
		
			
				|  |  |    src/compiler/php_plugin.cc
 | 
	
	
		
			
				|  | @@ -10435,6 +10479,8 @@ if (gRPC_INSTALL)
 | 
	
		
			
				|  |  |    )
 | 
	
		
			
				|  |  |  endif()
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +endif (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  | +if (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  add_executable(grpc_python_plugin
 | 
	
		
			
				|  |  |    src/compiler/python_plugin.cc
 | 
	
	
		
			
				|  | @@ -10469,6 +10515,8 @@ if (gRPC_INSTALL)
 | 
	
		
			
				|  |  |    )
 | 
	
		
			
				|  |  |  endif()
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +endif (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  | +if (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  add_executable(grpc_ruby_plugin
 | 
	
		
			
				|  |  |    src/compiler/ruby_plugin.cc
 | 
	
	
		
			
				|  | @@ -10503,6 +10551,7 @@ if (gRPC_INSTALL)
 | 
	
		
			
				|  |  |    )
 | 
	
		
			
				|  |  |  endif()
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +endif (gRPC_BUILD_CODEGEN)
 | 
	
		
			
				|  |  |  if (gRPC_BUILD_TESTS)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  add_executable(grpc_tool_test
 |