From 6db9794dc65cdebd64663f6c9bb0213b42c7df57 Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Sun, 3 Dec 2023 21:33:31 -0500 Subject: [PATCH 1/5] Workaround a msvc bug affecting msvc 19.38 --- src/utils/utils.hpp | 52 ++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/src/utils/utils.hpp b/src/utils/utils.hpp index eac96ce..1677aa5 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 _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 _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); From e1f91f18774d04d05bfbd1b37306b87573b4a99c Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Sun, 3 Dec 2023 21:34:50 -0500 Subject: [PATCH 2/5] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) 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 From 56b50d279aa84e55fb5bdd6b783ad812bc14b46f Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Mon, 4 Dec 2023 11:30:37 -0500 Subject: [PATCH 3/5] Update msvc bug workaround to not produce build warnings --- src/utils/utils.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/utils.hpp b/src/utils/utils.hpp index 1677aa5..ea0c53f 100644 --- a/src/utils/utils.hpp +++ b/src/utils/utils.hpp @@ -365,7 +365,7 @@ namespace detail { typename T, typename D // workaround a msvc bug https://developercommunity.visualstudio.com/t/MSVC-1938331290-preview-fails-to-comp/10505565 - #if _MSC_VER != 1938 + #if !defined(_MSC_VER) || _MSC_VER != 1938 , typename std::enable_if< std::is_same()(std::declval())), void>::value, @@ -415,7 +415,7 @@ namespace detail { typename T, typename D // workaround a msvc bug https://developercommunity.visualstudio.com/t/MSVC-1938331290-preview-fails-to-comp/10505565 - #if _MSC_VER != 1938 + #if !defined(_MSC_VER) || _MSC_VER != 1938 , typename std::enable_if< std::is_same()(std::declval())), void>::value, From 1f7c14ebb6f3b676eb3008c1fc41c9e12a13ab52 Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Tue, 5 Dec 2023 10:24:02 -0500 Subject: [PATCH 4/5] Update target names, pointed out in #66 --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c13ba28..b595f45 100644 --- a/README.md +++ b/README.md @@ -106,14 +106,14 @@ 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() @@ -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() From 5745399120864eb7903d25b483492b1436320819 Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Tue, 5 Dec 2023 11:09:10 -0500 Subject: [PATCH 5/5] Small wording update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b595f45..a848501 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ if(WIN32) 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