[CMake] If GRPC is disabled, don't use it
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 12 Jul 2019 07:46:16 +0000 (16:46 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 12 Jul 2019 07:46:16 +0000 (16:46 +0900)
TF_CORE_FRAMEWORK has been keep using it if it's NOT WIN32.

Change-Id: Ia3c9885459a1e906a8bffaad2ebdf0751ca62911
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
tensorflow/contrib/cmake/tf_core_framework.cmake

index 60a3039be0982a41c5dff1f60a6c4560cb51266f..ecde38ba088bb1111887eb694f4deab24fcf1be5 100644 (file)
@@ -49,7 +49,7 @@ function(RELATIVE_PROTOBUF_GENERATE_CPP SRCS HDRS ROOT_DIR)
   set(${HDRS} ${${HDRS}} PARENT_SCOPE)
 endfunction()
 
-if(NOT WIN32)
+if((NOT WIN32) AND (tensorflow_ENABLE_GRPC_SUPPORT))
   function(RELATIVE_PROTOBUF_GENERATE_GRPC_CPP SRCS HDRS ROOT_DIR)
     if(NOT ARGN)
       message(SEND_ERROR "Error: RELATIVE_PROTOBUF_GENERATE_GRPC_CPP() called without any proto files")
@@ -181,7 +181,7 @@ RELATIVE_PROTOBUF_TEXT_GENERATE_CPP(PROTO_TEXT_SRCS PROTO_TEXT_HDRS
     ${tensorflow_source_dir} ${tf_proto_text_srcs}
 )
 
-if(WIN32)
+if(WIN32 OR (NOT tensorflow_ENABLE_GRPC_SUPPORT))
   add_library(tf_protos_cc ${PROTO_SRCS} ${PROTO_HDRS})
 else()
   file(GLOB_RECURSE tf_protos_grpc_cc_srcs RELATIVE ${tensorflow_source_dir}