Index: lib/CMakeLists.txt =================================================================== --- lib/CMakeLists.txt +++ lib/CMakeLists.txt @@ -33,7 +33,6 @@ add_link_flags_if(LIBCXX_CXX_ABI_LIBRARY_PATH "${CMAKE_LIBRARY_PATH_FLAG}${LIBCXX_CXX_ABI_LIBRARY_PATH}") - if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY) find_compiler_rt_library(profile LIBCXX_COVERAGE_LIBRARY) endif() @@ -79,6 +78,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 +103,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)