When building the system libc++abi for Apple, we use CrashReporterClient
to provide better crash logs when calling abort(). This is exemplified by
the fact that we test for the presence of <CrashReporterClient.h> in
abort_message.cpp.
However, we must link against CrashReporterClient.a in order to get that
functionality, otherwise we get a linking error.
add_link_flags("-Wl,-rpath,${LIBDIR}")
endif()
endif()
+
+ # Make sure we link in CrashReporterClient if we find it -- it's used by
+ # abort() on Apple platforms when building the system dylib.
+ find_library(CrashReporterClient NAMES libCrashReporterClient.a
+ PATHS "${CMAKE_OSX_SYSROOT}/usr/local/lib")
+ if (CrashReporterClient)
+ message(STATUS "Linking with CrashReporterClient at ${CrashReporterClient}")
+ add_library_flags("${CrashReporterClient}")
+ else()
+ message(STATUS "Could not find CrashReporterClient, not linking against it")
+ endif()
endif()
split_list(LIBCXXABI_COMPILE_FLAGS)