[Aptitude-devel] [PATCH] build libgmock.a with tests
Daniel Hartwig
mandyke at gmail.com
Sun Aug 28 17:36:54 UTC 2011
tags 634413 + patch
quit
Re: #634413 aptitude: FTBFS: ld: cannot find -lgmock
It seems that `libgmock.a' is no longer provided precompiled [1].
Attached patch compiles it from the sources provided by the
`google-mock' and `libgtest-dev' packages.
After applying, run autoconf and automake to update `configure' and
`tests/Makefile.in'.
- `configure' will now pull the source directories from two
environment variables, GTEST_DIR and GMOCK_DIR, which default to
`/usr/src/{gtest,gmock}' respectively
- `Makefile' under `tests' will now compile `libgmock.a' and link
it in as appropriate.
Currently there are only simple file checks for `gmock-all.cc' and
`gtest-all.cc' to determine if the required sources are present. This
may not be robust enough but appears to work for now.
[1] From /usr/share/doc/google-mock/README.Debian:
Use of precompiled libgmock
---------------------------
The Google C++ Mocking Framework uses conditional compilation for
some things. Because of the C++ "One Definition Rule", gmock must
be compiled with exactly the same flags as your C++ code under
test. Because this is hard to manage, upstream no longer
recommends using precompiled libraries.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build-libgmock-a-with-tests.patch
Type: text/x-patch
Size: 2102 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/aptitude-devel/attachments/20110829/4d0921b0/attachment.bin>
More information about the Aptitude-devel
mailing list