31.10.2024 10:25, Omar Polo пишет:
> Hello,
>
> On 2024/10/30 21:31:15 +0100, Rafael Sadowski <rafael@sizeofvoid.org> wrote:
>> Bulk build log attached.
>
> +cc kirill, kn
>
>> [...]
>> FAILED: CMakeFiles/unit_ring_buffer_test.dir/toxav/ring_buffer_test.cc.o
>> /tmp/pobj/toxcore-0.2.19/bin/c++ -DCMP_NO_FLOAT=1 -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -isystem /usr/local/include -O2 -pipe -DNDEBUG -std=c++17 -MD -MT CMakeFiles/unit_ring_buffer_test.dir/toxav/ring_buffer_test.cc.o -MF CMakeFiles/unit_ring_buffer_test.dir/toxav/ring_buffer_test.cc.o.d -o CMakeFiles/unit_ring_buffer_test.dir/toxav/ring_buffer_test.cc.o -c /tmp/pobj/toxcore-0.2.19/c-toxcore-0.2.19/toxav/ring_buffer_test.cc
>> /tmp/pobj/toxcore-0.2.19/c-toxcore-0.2.19/toxav/ring_buffer_test.cc:3:10: fatal error: 'gtest/gtest.h' file not found
>> #include <gtest/gtest.h>
>> ^~~~~~~~~~~~~~~
>> 1 error generated.
>> ninja: build stopped: subcommand failed.
>
> I missed that gtest is also needed at build time to compile the tests.
At build time for cmake to find and build against, then at test time to run against
(dynamically linked); this is the usual pattern, not just with gtest.
>
> I'm attaching a boring diff to fix it. I'll be away for the weekend, so
> feel free to commit it with ok op@.
>
> I'm cc'ing kirill and kn to let them know but also because I knew kn did
> some work on disabling the building of tests in cmake ports. It could
> be interesting to do it here too if feasible, but my time right now is
> limited, and my cmake-fu limited as well =)
That's an optimisation to not effect regular build times when enabling tests.
Either way, unrelated to gtest itself and/or how it is used.
>
> sorry for dropping a diff and running away, i'll be back on sunday or
> monday at worst.
I just committed your diff to avoid the next bulk stumbling over this, thanks.
>
> Thank you!
>
>
> Index: Makefile
> ===================================================================
> RCS file: /home/cvs/ports/net/toxcore/Makefile,v
> diff -u -p -r1.13 Makefile
> --- Makefile 18 Oct 2024 08:05:52 -0000 1.13
> +++ Makefile 31 Oct 2024 07:20:35 -0000
> @@ -22,6 +22,8 @@ WANTLIB = c config m opus pthread sodium
> MODULES = devel/cmake
> COMPILER = base-clang ports-gcc
>
> +BUILD_DEPENDS = devel/gtest
> +
> LIB_DEPENDS = audio/opus \
> devel/libconfig \
> multimedia/libvpx \
>
No comments:
Post a Comment