From fc1b0d5c24b45c9bf496c8180ecc539b091dccf1 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sun, 9 Oct 2016 20:44:48 +0000 Subject: [PATCH] [libc++abi] Fix bug which cased the static libunwind to always be chosen llvm-svn: 283699 --- libcxxabi/src/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt index 7cbfdf5..2e08aa3 100644 --- a/libcxxabi/src/CMakeLists.txt +++ b/libcxxabi/src/CMakeLists.txt @@ -54,14 +54,14 @@ if (LIBCXXABI_ENABLE_THREADS) endif() append_if(libraries LIBCXXABI_HAS_C_LIB c) - if (LIBCXXABI_USE_LLVM_UNWINDER) - if (NOT LIBCXXABI_STANDALONE_BUILD) - if (LIBUNWIND_ENABLE_SHARED) - list(APPEND libraries unwind_shared) - else() - list(APPEND libraries unwind_static) - endif() + # Prefer using the in-tree version of libunwind, either shared or static. If + # none are found fall back to using -lunwind. + # FIXME: Is it correct to prefer the static version of libunwind? + if (TARGET unwind_shared) + list(APPEND libraries unwind_shared) + elseif(TARGET unwind_static) + list(APPEND libraries unwind_static) else() list(APPEND libraries unwind) endif() -- 2.7.4