THRIFT-5168 Useless generated code when .thrift file only has service type
Client: cpp
Patch: zeshuai007 <51382517@qq.com>

This closes #2095
diff --git a/tutorial/cpp/CMakeLists.txt b/tutorial/cpp/CMakeLists.txt
index c6d8fc3..b250a2c 100644
--- a/tutorial/cpp/CMakeLists.txt
+++ b/tutorial/cpp/CMakeLists.txt
@@ -30,7 +30,6 @@
 set(tutorialgencpp_SOURCES
     gen-cpp/Calculator.cpp
     gen-cpp/SharedService.cpp
-    gen-cpp/shared_constants.cpp
     gen-cpp/shared_types.cpp
     gen-cpp/tutorial_constants.cpp
     gen-cpp/tutorial_types.cpp
@@ -38,7 +37,7 @@
 add_library(tutorialgencpp STATIC ${tutorialgencpp_SOURCES})
 LINK_AGAINST_THRIFT_LIBRARY(tutorialgencpp thrift)
 
-add_custom_command(OUTPUT gen-cpp/Calculator.cpp gen-cpp/SharedService.cpp gen-cpp/shared_constants.cpp gen-cpp/shared_types.cpp gen-cpp/tutorial_constants.cpp gen-cpp/tutorial_types.cpp
+add_custom_command(OUTPUT gen-cpp/Calculator.cpp gen-cpp/SharedService.cpp gen-cpp/shared_types.cpp gen-cpp/tutorial_constants.cpp gen-cpp/tutorial_types.cpp
     COMMAND ${THRIFT_COMPILER} --gen cpp -r ${PROJECT_SOURCE_DIR}/tutorial/tutorial.thrift
 )
 
diff --git a/tutorial/cpp/Makefile.am b/tutorial/cpp/Makefile.am
index 95497d5..77fd6d5 100755
--- a/tutorial/cpp/Makefile.am
+++ b/tutorial/cpp/Makefile.am
@@ -27,8 +27,6 @@
 	gen-cpp/Calculator.h \
 	gen-cpp/SharedService.cpp \
 	gen-cpp/SharedService.h \
-	gen-cpp/shared_constants.cpp \
-	gen-cpp/shared_constants.h \
 	gen-cpp/shared_types.cpp \
 	gen-cpp/shared_types.h \
 	gen-cpp/tutorial_constants.cpp \
@@ -61,7 +59,7 @@
 #
 # Common thrift code generation rules
 #
-gen-cpp/Calculator.cpp gen-cpp/SharedService.cpp gen-cpp/shared_constants.cpp gen-cpp/shared_types.cpp gen-cpp/tutorial_constants.cpp gen-cpp/tutorial_types.cpp: $(top_srcdir)/tutorial/tutorial.thrift
+gen-cpp/Calculator.cpp gen-cpp/SharedService.cpp gen-cpp/shared_types.cpp gen-cpp/tutorial_constants.cpp gen-cpp/tutorial_types.cpp: $(top_srcdir)/tutorial/tutorial.thrift
 	$(THRIFT) --gen cpp -r $<
 
 AM_CPPFLAGS = $(BOOST_CPPFLAGS) $(LIBEVENT_CPPFLAGS) -I$(top_srcdir)/lib/cpp/src -Igen-cpp