Index: src/CMakeLists.txt =================================================================== --- src/CMakeLists.txt +++ src/CMakeLists.txt @@ -151,7 +151,13 @@ # Build the static library. if (LIBCXXABI_ENABLE_STATIC) - add_library(cxxabi_static STATIC $) + set(cxxabi_static_sources $) + if (LIBCXXABI_USE_LLVM_UNWINDER AND LIBCXXABI_ENABLE_STATIC_UNWINDER) + if (TARGET unwind_static OR HAVE_LIBUNWIND) + set(cxxabi_static_sources ${cxxabi_static_sources} $) + endif() + endif() + add_library(cxxabi_static STATIC ${cxxabi_static_sources}) target_link_libraries(cxxabi_static ${LIBCXXABI_LIBRARIES}) set_target_properties(cxxabi_static PROPERTIES