Index: lib/CMakeLists.txt =================================================================== --- lib/CMakeLists.txt +++ lib/CMakeLists.txt @@ -79,6 +79,17 @@ endif() endif() +# Add the unwinder library. +if (LIBCXXABI_USE_LLVM_UNWINDER) + if (NOT LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_shared OR HAVE_LIBUNWIND)) + add_interface_library(unwind_shared) + elseif (LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_static OR HAVE_LIBUNWIND)) + add_interface_library(unwind_static) + else() + add_interface_library(unwind) + endif() +endif() + # Generate private library list. add_library_flags_if(LIBCXX_HAS_PTHREAD_LIB pthread) add_library_flags_if(LIBCXX_HAS_C_LIB c) @@ -93,17 +104,6 @@ add_library_flags_if(LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB atomic) add_library_flags_if(MINGW "${MINGW_LIBRARIES}") -# Add the unwinder library. -if (LIBCXXABI_USE_LLVM_UNWINDER) - if (NOT LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_shared OR HAVE_LIBUNWIND)) - add_interface_library(unwind_shared) - elseif (LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_static OR HAVE_LIBUNWIND)) - add_interface_library(unwind_static) - else() - add_interface_library(unwind) - endif() -endif() - # Setup flags. if (NOT WIN32) add_flags_if_supported(-fPIC)