You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by qi...@apache.org on 2017/07/27 05:47:22 UTC
[3/3] mesos git commit: Generated protobuf_tests.pb.* files during
the build.
Generated protobuf_tests.pb.* files during the build.
Review: https://reviews.apache.org/r/60109/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e6ec4e83
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e6ec4e83
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e6ec4e83
Branch: refs/heads/master
Commit: e6ec4e8362552cbaf74bf3e844e7ac4b15f9aafd
Parents: fc27129
Author: Qian Zhang <zh...@gmail.com>
Authored: Thu Jul 27 09:45:48 2017 +0800
Committer: Qian Zhang <zh...@gmail.com>
Committed: Thu Jul 27 09:45:48 2017 +0800
----------------------------------------------------------------------
3rdparty/stout/Makefile.am | 20 +-
3rdparty/stout/configure.ac | 2 +
3rdparty/stout/tests/CMakeLists.txt | 11 +
3rdparty/stout/tests/protobuf_tests.pb.cc | 3985 ------------------------
3rdparty/stout/tests/protobuf_tests.pb.h | 2262 --------------
5 files changed, 31 insertions(+), 6249 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/e6ec4e83/3rdparty/stout/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/stout/Makefile.am b/3rdparty/stout/Makefile.am
index 7956d1a..20c3c1b 100644
--- a/3rdparty/stout/Makefile.am
+++ b/3rdparty/stout/Makefile.am
@@ -110,10 +110,18 @@ PROTOBUF_INCLUDE_FLAGS = -I$(PROTOBUF)/src
LIB_PROTOBUF = $(PROTOBUF)/src/libprotobuf.la
$(LIB_PROTOBUF): $(PROTOBUF)-build-stamp
BUNDLED_DEPS += $(PROTOBUF)-build-stamp
+PROTOC = $(PROTOBUF)/src/protoc
else
LIB_PROTOBUF = -lprotobuf
+PROTOC = @PROTOCOMPILER@
endif
+PROTOCFLAGS = -I$(srcdir)/tests
+
+# Targets for generating C++ protocol buffer code.
+protobuf_tests.pb.cc protobuf_tests.pb.h: tests/protobuf_tests.proto
+ $(PROTOC) $(PROTOCFLAGS) --cpp_out=$(builddir) $^
+
# Tests for stout.
check_PROGRAMS = stout-tests
@@ -154,8 +162,6 @@ stout_tests_SOURCES = \
tests/os/systems_tests.cpp \
tests/path_tests.cpp \
tests/protobuf_tests.cpp \
- tests/protobuf_tests.pb.cc \
- tests/protobuf_tests.pb.h \
tests/protobuf_tests.proto \
tests/recordio_tests.cpp \
tests/result_tests.cpp \
@@ -204,6 +210,16 @@ endif
BUILT_SOURCES = $(BUNDLED_DEPS)
+BUILT_SOURCES += \
+ protobuf_tests.pb.cc
+
+nodist_stout_tests_SOURCES = \
+ protobuf_tests.pb.cc
+
+CLEANFILES = \
+ protobuf_tests.pb.cc \
+ protobuf_tests.pb.h
+
# We use a check-local target for now to avoid the parallel test
# runner that ships with newer versions of autotools.
# See the following discussion for the workaround:
http://git-wip-us.apache.org/repos/asf/mesos/blob/e6ec4e83/3rdparty/stout/configure.ac
----------------------------------------------------------------------
diff --git a/3rdparty/stout/configure.ac b/3rdparty/stout/configure.ac
index abb6521..6db2287 100644
--- a/3rdparty/stout/configure.ac
+++ b/3rdparty/stout/configure.ac
@@ -520,6 +520,7 @@ if test "x$without_bundled_protobuf" = "xyes" || \
AC_MSG_ERROR([protoc not found in PATH])
fi
+ PROTOCOMPILER="$PROTOBUFPREFIX/bin/protoc"
else
AC_MSG_ERROR([cannot find protobuf
-------------------------------------------------------------------
@@ -539,6 +540,7 @@ fi
AM_CONDITIONAL([WITH_BUNDLED_PROTOBUF],
[test "x$with_bundled_protobuf" = "xyes"])
+AC_SUBST([PROTOCOMPILER])
# Check if libsvn-1 prefix path was provided, and if so, add it to
# the CPPFLAGS and LDFLAGS with respective /include and /lib path
http://git-wip-us.apache.org/repos/asf/mesos/blob/e6ec4e83/3rdparty/stout/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/CMakeLists.txt b/3rdparty/stout/tests/CMakeLists.txt
index 8d881ab..12882ee 100644
--- a/3rdparty/stout/tests/CMakeLists.txt
+++ b/3rdparty/stout/tests/CMakeLists.txt
@@ -99,12 +99,23 @@ set(STOUT_TESTS_SRC
#############################################################################
include_directories(SYSTEM ${STOUT_TEST_3RDPARTY_INCLUDE_DIRS})
include_directories(${STOUT_INCLUDE_DIRS})
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
# LINKING LIBRARIES BY DIRECTORY (might generate, e.g., -L/path/to/thing on
# Linux).
###########################################################################
link_directories(${STOUT_TEST_LIB_DIRS})
+# THE C++ PROTOCOL BUFFER CODE (protobuf_tests.pb.h and protobuf_tests.pb.cc).
+##############################################################################
+add_custom_command(
+ OUTPUT protobuf_tests.pb.h protobuf_tests.pb.cc
+ COMMAND ${PROTOC}
+ -I${CMAKE_SOURCE_DIR}/3rdparty/stout/tests
+ --cpp_out=.
+ ${CMAKE_SOURCE_DIR}/3rdparty/stout/tests/protobuf_tests.proto
+ DEPENDS ${CMAKE_SOURCE_DIR}/3rdparty/stout/tests/protobuf_tests.proto)
+
# THE STOUT TEST EXECUTABLE (generates, e.g., stout-tests, etc., on Linux).
###########################################################################
add_executable(${STOUT_TESTS_TARGET} EXCLUDE_FROM_ALL ${STOUT_TESTS_SRC})