vitalybuka added a comment. Maybe? - if (UNIX AND NOT (APPLE OR CYGWIN)) + if (LIBCXXABI_ENABLE_THREADS AND UNIX AND NOT (APPLE OR CYGWIN)) list(APPEND LIBCXXABI_SOURCES cxa_thread_atexit.cpp) endif() https://reviews.llvm.org/D24864