# LIBUNWIND_HAS_UNW_INIT_LOCAL - True if unw_init_local() is found (optional).
# LIBUNWIND_HAS_UNW_BACKTRACE - True if unw_backtrace() is found (required).
# LIBUNWIND_HAS_UNW_BACKTRACE_SKIP - True if unw_backtrace_skip() is found (optional).
-# LIBUNWIND_HAS_UNW_SET_CACHE_SIZE - True if unw_set_cache_size() is found (optional).
# LIBUNWIND_VERSION_STRING - version number as a string (ex: "5.0.3")
#=============================================================================
check_library_exists(${LIBUNWIND_LIBRARY} unw_init_local "" LIBUNWIND_HAS_UNW_INIT_LOCAL)
check_library_exists(${LIBUNWIND_LIBRARY} unw_backtrace "" LIBUNWIND_HAS_UNW_BACKTRACE)
check_library_exists (${LIBUNWIND_LIBRARY} unw_backtrace_skip "" LIBUNWIND_HAS_UNW_BACKTRACE_SKIP)
- # TODO: find the symbol name on 32bit/arm platforms
- check_library_exists (${LIBUNWIND_LIBRARY} _ULx86_64_set_cache_size "" LIBUNWIND_HAS_UNW_SET_CACHE_SIZE)
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
endif ()
if (unw_set_caching_policy(unw_local_addr_space, UNW_CACHE_PER_THREAD)) {
fprintf(stderr, "WARNING: Failed to enable per-thread libunwind caching.\n");
}
- #if LIBUNWIND_HAS_UNW_SET_CACHE_SIZE
- if (unw_set_cache_size(unw_local_addr_space, 1024)) {
+ #ifdef unw_set_cache_size
+ if (unw_set_cache_size(unw_local_addr_space, 1024, 0)) {
fprintf(stderr, "WARNING: Failed to set libunwind cache size.\n");
}
#endif
#ifndef LIBUNWIND_CONFIG_H
#define LIBUNWIND_CONFIG_H
-#cmakedefine01 LIBUNWIND_HAS_UNW_SET_CACHE_SIZE
-
#cmakedefine01 LIBUNWIND_HAS_UNW_BACKTRACE
#cmakedefine01 LIBUNWIND_HAS_UNW_BACKTRACE_SKIP