aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-01-08 16:34:08 -0800
committerRiccardo Spagni <ric@spagni.net>2017-01-08 16:34:08 -0800
commitc594e578a97851dad3688eb018525e1153d85319 (patch)
tree362952e1ef9f92713ae5e5e69079898d2f293ac3
parentMerge pull request #1493 (diff)
parentcmake: link against liblzma when found, for libunwind (diff)
downloadmonero-c594e578a97851dad3688eb018525e1153d85319.tar.xz
Merge pull request #1494
0020ad7d cmake: link against liblzma when found, for libunwind (moneromooo-monero)
-rw-r--r--cmake/FindLibunwind.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/cmake/FindLibunwind.cmake b/cmake/FindLibunwind.cmake
index 9946e7cdd..af657cad1 100644
--- a/cmake/FindLibunwind.cmake
+++ b/cmake/FindLibunwind.cmake
@@ -17,6 +17,22 @@ find_path(LIBUNWIND_INCLUDE_DIR libunwind.h
)
find_library(LIBUNWIND_LIBRARIES NAMES unwind )
+if(NOT LIBUNWIND_LIBRARIES STREQUAL "LIBUNWIND_LIBRARIES-NOTFOUND")
+ if (CMAKE_COMPILER_IS_GNUCC)
+ set(LIBUNWIND_LIBRARIES "gcc_eh;${LIBUNWIND_LIBRARIES}")
+ endif()
+endif()
+
+# some versions of libunwind need liblzma, and we don't use pkg-config
+# so we just look whether liblzma is installed, and add it if it is.
+# It might not be actually needed, but doesn't hurt if it is not.
+# We don't need any headers, just the lib, as it's privately needed.
+message(STATUS "looking for liblzma")
+find_library(LIBLZMA_LIBRARIES lzma )
+if(NOT LIBLZMA_LIBRARIES STREQUAL "LIBLZMA_LIBRARIES-NOTFOUND")
+ message(STATUS "liblzma found")
+ set(LIBUNWIND_LIBRARIES "${LIBUNWIND_LIBRARIES};${LIBLZMA_LIBRARIES}")
+endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libunwind "Could not find libunwind" LIBUNWIND_INCLUDE_DIR LIBUNWIND_LIBRARIES)