From 8453b0856b4b35083820bf6e6abf5feb193b02c9 Mon Sep 17 00:00:00 2001 From: Sergiu Dotenco Date: Tue, 21 Apr 2015 16:11:25 +0200 Subject: [PATCH] cmake: link to libunwind --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb0b16c..a1978c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,6 +104,9 @@ check_symbol_exists (snprintf stdio.h HAVE_SNPRINTF) check_library_exists (unwind get_static_proc_name "" HAVE_LIB_UNWIND) +find_library (UNWIND_LIBRARY NAMES unwind DOC "unwind library") +mark_as_advanced (UNWIND_LIBRARY) + check_c_source_compiles (" #include static void foo(void) __attribute__ ((unused)); @@ -358,6 +361,10 @@ add_library (glog ${GLOG_SRCS} ) +if (UNWIND_LIBRARY) + target_link_libraries (glog PUBLIC ${UNWIND_LIBRARY}) +endif (UNWIND_LIBRARY) + if (WIN32 AND HAVE_SNPRINTF) set_property (SOURCE src/windows/port.cc APPEND PROPERTY COMPILE_DEFINITIONS HAVE_SNPRINTF) -- 2.34.1