Closed FabienPean closed 3 years ago
Thanks. I asked colleagues to try it on a Mac. In the meantime...With g++ 7 and g++ 9, I get a warning:
In file included from /tmp/yomm2/examples/dl_shared.cpp:9:0:
/tmp/yomm2/include/yorel/yomm2.hpp:264:45: warning: inline variables are only available with -std=c++1z or -std=gnu++1z
inline typename next_ptr_t<Signature>::type next;
And with clang++ 9 and 11, lots of:
/tmp/yomm2/include/yorel/yomm2.hpp:495:64: warning: static_assert with no message is a C++17
extension [-Wc++17-extensions]
static_assert(shared_ptr_traits<DERIVED>::is_shared_ptr);
Which compiler did you test with?
Hi, I just reworked the CMakeLists upfront and was going to rely on the CI for checking validity.
The warnings seem all related to the example dl_shared
. This happens because dl_shared
is not "linked" to target yomm2 but instead it just extracts the include directory from the target yomm2. Solutions are either
target_link_libraries(dl_shared YOMM2::yomm2)
but I assume it is using only the include directory for some reason.target_compile_features(dl_shared PUBLIC cxx_std_17)
to explicitly enforce correct standard use (minimal effort)dl_shared
problem can be solved with target_link_libraries(dl_shared YOMM2::yomm2_headers)
. This requires more work, but might make more sense if it is a common scenario.For OSX no need really to go over it, the CI of microsoft/vcpkg would let me know if there is still an issue. The problem seemed that that the compiler id has changed and is now AppleClang instead of just Clang, so the C++17 flag was not set.
@FabienPean Can you tell me a bit more about what you use (or plan to use) YOMM2 for? Is that work available as open source? I would like to make a list of projects in which the library is used. But if you are not allowed to talk about it it's all right too.
Nothing really targeted I'm afraid. I heard about the library from your talk at cppcon some years ago and wanted to refresh my memory because I think it is a really interesting solution. Since I like using vcpkg quite much for using/testing libraries and saw that yomm2 had a CMakeLists, I decided to bring it up there for easier consumption and access. It should be soon merged: microsoft/vcpkg#17886 If I were to use it into some relevant piece of work, I will announce it here then :)
It has been merged into vcpkg :)
It has been merged into vcpkg :)
Cool :)
Add C++17 as a required feature of the library in a generic way. This should probably be sufficient to allow the library to be packaged for OSX in vcpkg.