cern-fts / davix

High-performance file management over WebDAV / HTTP
GNU Lesser General Public License v2.1
84 stars 36 forks source link

Davix 0.7.4 conflicts with system gtest 1.8.1 #47

Open daritter opened 5 years ago

daritter commented 5 years ago

When trying to compile davix 0.7.4 I ran into a compiler error because a function definition changed in the bundled version of googletest since the latest release 1.8.1

In file included from davix/deps/googletest/googletest/src/gtest-all.cc:45:
davix/deps/googletest/googletest/src/gtest-port.cc:1211:13: error: ambiguating new declaration of 'const char* testing::internal::StringFromGTestEnv(const char*, const char*)'
 const char* StringFromGTestEnv(const char* flag, const char* default_value) {
             ^~~~~~~~~~~~~~~~~~
In file included from common/include/gtest/internal/gtest-internal.h:40,
                 from /common/include/gtest/gtest.h:58,
                 from /davix/deps/googletest/googletest/src/gtest-all.cc:39:
include/gtest/internal/gtest-port.h:2549:13: note: old declaration 'std::__cxx11::string testing::internal::StringFromGTestEnv(const char*, const char*)'
 std::string StringFromGTestEnv(const char* flag, const char* default_val);
             ^~~~~~~~~~~~~~~~~~

googletest 1.8.1 is installed in a common include directory with libuuid so I cannot easily hide it from davix.

As a simple solution, would it be possible to include an option to not build the tests at all?

gbitzes commented 5 years ago

Hi, thanks for the bug report. davix should indeed prefer the headers of its own bundled gtest, and if it doesn't that's a bug indeed.

I'll also add a flag to skip building the tests entirely.