You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2017/08/24 02:18:42 UTC

kudu git commit: [cmake] introduce 'pb-gen' and 'krpc-gen' targets

Repository: kudu
Updated Branches:
  refs/heads/master 71f5fbdaa -> f33a13c12


[cmake] introduce 'pb-gen' and 'krpc-gen' targets

Introduced new targets to generate protobuf stubs and KRPC service/proxy
files.

The 'iwyu' target now depends on the newly introduced 'pb-gen' and
'krpc-gen' targets.  That's because IWYU needs to have all protobuf
and KRPC headers available when running.

Change-Id: I48833098553ef7d3f4fae8b88079cb354b52bea1
Reviewed-on: http://gerrit.cloudera.org:8080/7777
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Tested-by: Alexey Serbin <as...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/f33a13c1
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/f33a13c1
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/f33a13c1

Branch: refs/heads/master
Commit: f33a13c128140cb046cc71c47287d7cd0f4e9a2d
Parents: 71f5fbd
Author: Alexey Serbin <as...@cloudera.com>
Authored: Tue Aug 22 22:12:42 2017 -0700
Committer: Alexey Serbin <as...@cloudera.com>
Committed: Thu Aug 24 02:14:03 2017 +0000

----------------------------------------------------------------------
 CMakeLists.txt                   | 15 +++++++++++++++
 cmake_modules/FindKRPC.cmake     |  4 ++++
 cmake_modules/FindProtobuf.cmake |  4 ++++
 3 files changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/f33a13c1/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3ab6178..0c3065c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1050,10 +1050,25 @@ if (UNIX)
 endif (UNIX)
 
 ############################################################
+# "make pb-gen": generate all protobuf source/header files
+############################################################
+if (UNIX)
+  add_custom_target(pb-gen)
+endif (UNIX)
+
+############################################################
+# "make krpc-gen": generate all KRPC source/header files
+############################################################
+if (UNIX)
+  add_custom_target(krpc-gen)
+endif (UNIX)
+
+############################################################
 # "make iwyu" target
 ############################################################
 if (UNIX)
   add_custom_target(iwyu ${BUILD_SUPPORT_DIR}/iwyu/iwyu.sh)
+  add_dependencies(iwyu pb-gen krpc-gen)
 endif (UNIX)
 
 ############################################################

http://git-wip-us.apache.org/repos/asf/kudu/blob/f33a13c1/cmake_modules/FindKRPC.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindKRPC.cmake b/cmake_modules/FindKRPC.cmake
index 996d9f5..35e20d6 100644
--- a/cmake_modules/FindKRPC.cmake
+++ b/cmake_modules/FindKRPC.cmake
@@ -110,4 +110,8 @@ function(KRPC_GENERATE SRCS HDRS TGTS)
   set(${SRCS} ${${SRCS}} PARENT_SCOPE)
   set(${HDRS} ${${HDRS}} PARENT_SCOPE)
   set(${TGTS} ${${TGTS}} PARENT_SCOPE)
+
+  # The 'krpc-gen' is a high-level target in $KUDU_ROOT/CMakeLists.txt to
+  # generate all KRPC proxy/service stub files.
+  add_dependencies(krpc-gen ${${TGTS}})
 endfunction()

http://git-wip-us.apache.org/repos/asf/kudu/blob/f33a13c1/cmake_modules/FindProtobuf.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindProtobuf.cmake b/cmake_modules/FindProtobuf.cmake
index ab393c7..19959a9 100644
--- a/cmake_modules/FindProtobuf.cmake
+++ b/cmake_modules/FindProtobuf.cmake
@@ -188,6 +188,10 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS TGTS)
   set(${SRCS} ${${SRCS}} PARENT_SCOPE)
   set(${HDRS} ${${HDRS}} PARENT_SCOPE)
   set(${TGTS} ${${TGTS}} PARENT_SCOPE)
+
+  # The 'pb-gen' is a high-level target in $KUDU_ROOT/CMakeLists.txt to
+  # process protobuf definitions and generate corresponding header/source files.
+  add_dependencies(pb-gen ${${TGTS}})
 endfunction()