Merge branch 'main' into dev

This commit is contained in:
Jeremy 2023-12-05 23:01:01 -05:00
commit 71366555b0
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4
3 changed files with 38 additions and 27 deletions

View File

@ -12,6 +12,9 @@
Tiny patch: Tiny patch:
- Fix `CPPTRACE_EXPORT` annotations - 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 # v0.3.0

View File

@ -106,20 +106,20 @@ FetchContent_Declare(
GIT_TAG v0.3.1 # <HASH or TAG> GIT_TAG v0.3.1 # <HASH or TAG>
) )
FetchContent_MakeAvailable(cpptrace) 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 # On windows copy cpptrace.dll to the same directory as the executable for your_target
if(WIN32) if(WIN32)
add_custom_command( add_custom_command(
TARGET your_target POST_BUILD TARGET your_target POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:cpptrace> $<TARGET_FILE:cpptrace::cpptrace>
$<TARGET_FILE_DIR:your_target> $<TARGET_FILE_DIR:your_target>
) )
endif() 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 # In-Depth Documentation
@ -553,7 +553,7 @@ FetchContent_Declare(
GIT_TAG v0.3.1 # <HASH or TAG> GIT_TAG v0.3.1 # <HASH or TAG>
) )
FetchContent_MakeAvailable(cpptrace) 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 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( add_custom_command(
TARGET your_target POST_BUILD TARGET your_target POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:cpptrace> $<TARGET_FILE:cpptrace::cpptrace>
$<TARGET_FILE_DIR:your_target> $<TARGET_FILE_DIR:your_target>
) )
endif() endif()

View File

@ -363,7 +363,10 @@ namespace detail {
template< template<
typename T, typename T,
typename D, 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< typename std::enable_if<
std::is_same<decltype(std::declval<D>()(std::declval<T>())), void>::value, std::is_same<decltype(std::declval<D>()(std::declval<T>())), void>::value,
int int
@ -376,6 +379,7 @@ namespace detail {
std::is_nothrow_move_constructible<T>::value, std::is_nothrow_move_constructible<T>::value,
int int
>::type = 0 >::type = 0
#endif
> >
class raii_wrapper { class raii_wrapper {
T obj; T obj;
@ -409,7 +413,10 @@ namespace detail {
template< template<
typename T, typename T,
typename D, 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< typename std::enable_if<
std::is_same<decltype(std::declval<D>()(std::declval<T>())), void>::value, std::is_same<decltype(std::declval<D>()(std::declval<T>())), void>::value,
int int
@ -418,6 +425,7 @@ namespace detail {
std::is_standard_layout<T>::value && std::is_trivial<T>::value, std::is_standard_layout<T>::value && std::is_trivial<T>::value,
int int
>::type = 0 >::type = 0
#endif
> >
raii_wrapper<typename std::remove_reference<T>::type, D> raii_wrap(T obj, D deleter) { raii_wrapper<typename std::remove_reference<T>::type, D> raii_wrap(T obj, D deleter) {
return raii_wrapper<typename std::remove_reference<T>::type, D>(obj, deleter); return raii_wrapper<typename std::remove_reference<T>::type, D>(obj, deleter);