Introduce a cmake module to figure out whether we need to link with libatomic.

Summary:
This fixes the tests under std/atomics for 32-bit MIPS CPUs where the
8-byte atomic operations call into the libatomic library.

Reviewers: dsanders, mclow.lists, EricWF, jroelofs, joerg

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D16613

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@260235 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vasileios Kalintiris
2016-02-09 17:00:38 +00:00
parent 81b46a5bc6
commit b56fdea386
6 changed files with 49 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
include(CheckLibraryExists)
include(CheckCXXCompilerFlag)
include(CheckLibcxxAtomic)
# Check compiler flags
@@ -17,3 +18,7 @@ check_library_exists(c fopen "" LIBCXX_HAS_C_LIB)
check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)
check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)
check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)
if (NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
set(LIBCXX_HAS_ATOMIC_LIB True)
endif()