Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
SET(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
endif()

if(CPPTRACE_DELAYLOAD_DBGHELP AND BUILD_SHARED_LIBS AND MSVC)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should also check if we're actually using dbghelp, i.e. CPPTRACE_UNWIND_WITH_DBGHELP OR CPPTRACE_GET_SYMBOLS_WITH_DBGHELP OR CPPTRACE_DEMANGLE_WITH_WINAPI. Unfortunately it'll be a bit of a nasty condition :)

target_link_libraries(${target_name} PRIVATE delayimp.lib)
target_link_options(${target_name} PRIVATE /DELAYLOAD:dbghelp.dll)
endif()

# =================================================== Back-end setup ===================================================

if(HAS_CXX_EXCEPTION_TYPE)
Expand Down
1 change: 1 addition & 0 deletions cmake/OptionVariables.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ set(CPPTRACE_LIBDWARF_SHALLOW "1" CACHE STRING "")
option(CPPTRACE_PROVIDE_EXPORT_SET "" ON)
option(CPPTRACE_PROVIDE_EXPORT_SET_FOR_LIBDWARF "" OFF)
option(CPPTRACE_DISABLE_CXX_20_MODULES "" OFF)
option(CPPTRACE_DELAYLOAD_DBGHELP "" OFF)

mark_as_advanced(
CPPTRACE_BACKTRACE_PATH
Expand Down
Loading