Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
451223a3
Commit
451223a3
authored
Jun 25, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bundle gtest into autotool build, simplifying usage.
parent
18608f7b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
8 deletions
+68
-8
.gitignore
.gitignore
+3
-0
Makefile.am
c++/Makefile.am
+35
-7
configure.ac
c++/configure.ac
+6
-1
gtest-1.6.0-c++11.patch
c++/gtest-1.6.0-c++11.patch
+0
-0
setup-autotools.sh
c++/setup-autotools.sh
+24
-0
No files found.
.gitignore
View file @
451223a3
...
...
@@ -24,6 +24,9 @@
# setup-ekam.sh
/c++/.ekam
# setup-autotools.sh
/c++/gtest
# Jekyll-generated site
/doc/_site
...
...
c++/Makefile.am
View file @
451223a3
...
...
@@ -4,6 +4,35 @@ ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS
=
foreign
# Always include gtest in distributions.
DIST_SUBDIRS
=
$(subdirs)
# Build gtest before we build Cap'n Proto tests. We don't add gtest to SUBDIRS
# because then "make check" would also build and run all of gtest's own tests,
# which takes a lot of time and is generally not useful to us. Also, we don't
# want "make install" to recurse into gtest since we don't want to overwrite
# the installed version of gtest if there is one (and, actually, gtest doesn't
# even support "make install" anyway). So we define a rule such that it will
# only be built when needed.
gtest/lib/libgtest.la
:
@
echo
"Making lib/libgtest.a lib/libgtest_main.a in gtest"
@
cd
gtest
&&
$(MAKE)
$(AM_MAKEFLAGS)
lib/libgtest.la lib/libgtest_main.la
gtest/lib/libgtest_main.la
:
gtest/lib/libgtest.la
@
:
# We would like to clean gtest when "make clean" is invoked. But we have to
# be careful because clean-local is also invoked during "make distclean", but
# "make distclean" already recurses into gtest because it's listed among the
# DIST_SUBDIRS. distclean will delete gtest/Makefile, so if we then try to
# cd to the directory again and "make clean" it will fail. So, check that the
# Makefile exists before recursing.
clean-local
:
@
if
test
-e
gtest/Makefile
;
then
\
echo
"Making clean in gtest"
;
\
cd
gtest
&&
$(MAKE)
$(AM_MAKEFLAGS)
clean
;
\
fi
AM_CXXFLAGS
=
-I
$(srcdir)
/src
-I
$(builddir)
/src
EXTRA_DIST
=
\
...
...
@@ -97,12 +126,10 @@ includecapnp_HEADERS = \
nodist_includecapnp_HEADERS
=
\
src/capnp/schema.capnp.h
# No dynamic library for now since C++ binary compatibility is hard.
# It may make more sense to have every module statically link Cap'n Proto
# and pass around messages via memory pointers.
lib_LIBRARIES
=
libcapnp.a
lib_LTLIBRARIES
=
libcapnp.la
libcapnp_a_SOURCES
=
\
libcapnp_la_LDFLAGS
=
-release
$(VERSION)
-export-dynamic
-no-undefined
libcapnp_la_SOURCES
=
\
src/kj/common.c++
\
src/kj/units.c++
\
src/kj/memory.c++
\
...
...
@@ -123,7 +150,7 @@ libcapnp_a_SOURCES= \
src/capnp/stringify.c++
\
src/capnp/serialize.c++
\
src/capnp/serialize-packed.c++
nodist_libcapnp_
a_SOURCES
=
\
nodist_libcapnp_
la_SOURCES
=
\
src/capnp/schema.capnp.c++
\
src/capnp/c++.capnp.c++
...
...
@@ -147,7 +174,8 @@ test_capnpc_outputs = \
BUILT_SOURCES
=
$(test_capnpc_outputs)
$(capnpc_outputs)
check_PROGRAMS
=
capnp-test
capnp_test_LDADD
=
-lgtest
-lgtest_main
libcapnp.a
capnp_test_LDADD
=
gtest/lib/libgtest.la gtest/lib/libgtest_main.la libcapnp.la
capnp_test_CPPFLAGS
=
-Igtest
/include
-I
$(srcdir)
/gtest/include
capnp_test_SOURCES
=
\
src/kj/common-test.c++
\
src/kj/memory-test.c++
\
...
...
c++/configure.ac
View file @
451223a3
...
...
@@ -23,13 +23,18 @@ AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
AC_LANG([C++])
AX_CXX_COMPILE_STDCXX_11([noext])
ACX_PTHREAD
AC_PROG_LIBTOOL
LIBS="$PTHREAD_LIBS $LIBS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
# We need gtest to use the same CXXFLAGS, especially -std and -stdlib, so export them before
# configuring gtest.
export CXXFLAGS
AC_CONFIG_SUBDIRS([gtest])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
c++/gtest-1.6.0-c++11.patch
0 → 100644
View file @
451223a3
This diff is collapsed.
Click to expand it.
c++/setup-autotools.sh
0 → 100755
View file @
451223a3
#! /bin/bash
set
-euo
pipefail
if
[
!
-e
gtest
]
;
then
echo
"================================================================================"
echo
"Fetching Google Test code..."
echo
"================================================================================"
svn checkout http://googletest.googlecode.com/svn/tags/release-1.6.0 gtest
echo
"================================================================================"
echo
"Patching Google Test for C++11..."
echo
"================================================================================"
cd
gtest
patch
-p0
< ../gtest-1.6.0-c++11.patch
cd
..
fi
echo
"================================================================================"
echo
"Done"
echo
"================================================================================"
echo
echo
"Ready to run autoreconf. For example:"
echo
" autoreconf -i && ./configure && make -j6 check && sudo make install"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment