On Thursday, 9 November 2017 09:58:26 CET Tomaz Canabrava wrote: > On Sun, Nov 5, 2017 at 4:12 PM, Michail Vourlakos <mvourla...@gmail.com> > > > during the review phase in Latte we removed the following code in case it > > would conflict in some cases: > > > > #if __GLIBCXX__ <= 20150623 > > namespace std { > > template<class T, class... Args> > > unique_ptr<T> make_unique(Args &&... args) .. > > #endif > > > > > > this was needed for gcc versions that even though they are C++14 > > compatible they dont offer make_unique function. By removing that code we > > broke compatibility with openSUSE Leap that uses gcc 4.8.5 ... so in order > > to build latte packages a made a patch to readd that code.
The problem was at least partly (IIRC) that the check doesn't detect Clang, and then defines a duplicate (language-lawyering says it's undefined behavior). The problem isn't so much with gcc itself, as with the C++ STL version it ships with. I wanted to point you to https://cmake.org/cmake/help/v3.8/prop_gbl/ CMAKE_CXX_KNOWN_FEATURES.html , but has-make-unique is not one other features CMake knows about. As Sven points out, using symbol_exists() might work, or easier might be a try_compile() which will definitely tell you if std::make_unique<T> compiles on the local system. [ade]
signature.asc
Description: This is a digitally signed message part.