diff --git a/CHANGELOG.md b/CHANGELOG.md index f19ebfd..98abde4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ Tiny patch: - Fix `CPPTRACE_EXPORT` annotations +- Add workaround for [msvc bug][msvc bug] affecting msvc 19.38. + +[msvc bug]: https://developercommunity.visualstudio.com/t/MSVC-1938331290-preview-fails-to-comp/10505565 # v0.3.0 diff --git a/README.md b/README.md index c13ba28..a848501 100644 --- a/README.md +++ b/README.md @@ -106,20 +106,20 @@ FetchContent_Declare( GIT_TAG v0.3.1 # ) FetchContent_MakeAvailable(cpptrace) -target_link_libraries(your_target cpptrace) +target_link_libraries(your_target cpptrace::cpptrace) # On windows copy cpptrace.dll to the same directory as the executable for your_target if(WIN32) add_custom_command( TARGET your_target POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different - $ + $ $ ) endif() ``` -On windows and macos some extra work is required, see [below](#platform-logistics). +On macos a little extra work to generate a .dSYM file is required, see [below](#platform-logistics). # In-Depth Documentation @@ -553,7 +553,7 @@ FetchContent_Declare( GIT_TAG v0.3.1 # ) FetchContent_MakeAvailable(cpptrace) -target_link_libraries(your_target cpptrace) +target_link_libraries(your_target cpptrace::cpptrace) ``` It's as easy as that. Cpptrace will automatically configure itself for your system. Note: On windows and macos some @@ -683,7 +683,7 @@ if(WIN32) add_custom_command( TARGET your_target POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different - $ + $ $ ) endif() diff --git a/src/utils/utils.hpp b/src/utils/utils.hpp index eac96ce..ea0c53f 100644 --- a/src/utils/utils.hpp +++ b/src/utils/utils.hpp @@ -363,19 +363,23 @@ namespace detail { template< typename T, - typename D, - typename std::enable_if< - std::is_same()(std::declval())), void>::value, - int - >::type = 0, - typename std::enable_if< - std::is_standard_layout::value && std::is_trivial::value, - int - >::type = 0, - typename std::enable_if< - std::is_nothrow_move_constructible::value, - int - >::type = 0 + typename D + // workaround a msvc bug https://developercommunity.visualstudio.com/t/MSVC-1938331290-preview-fails-to-comp/10505565 + #if !defined(_MSC_VER) || _MSC_VER != 1938 + , + typename std::enable_if< + std::is_same()(std::declval())), void>::value, + int + >::type = 0, + typename std::enable_if< + std::is_standard_layout::value && std::is_trivial::value, + int + >::type = 0, + typename std::enable_if< + std::is_nothrow_move_constructible::value, + int + >::type = 0 + #endif > class raii_wrapper { T obj; @@ -409,15 +413,19 @@ namespace detail { template< typename T, - typename D, - typename std::enable_if< - std::is_same()(std::declval())), void>::value, - int - >::type = 0, - typename std::enable_if< - std::is_standard_layout::value && std::is_trivial::value, - int - >::type = 0 + typename D + // workaround a msvc bug https://developercommunity.visualstudio.com/t/MSVC-1938331290-preview-fails-to-comp/10505565 + #if !defined(_MSC_VER) || _MSC_VER != 1938 + , + typename std::enable_if< + std::is_same()(std::declval())), void>::value, + int + >::type = 0, + typename std::enable_if< + std::is_standard_layout::value && std::is_trivial::value, + int + >::type = 0 + #endif > raii_wrapper::type, D> raii_wrap(T obj, D deleter) { return raii_wrapper::type, D>(obj, deleter);