This revision was automatically updated to reflect the committed changes.
Closed by commit rL329167: [libcxx][cmake] Remove libatomic temporarily from 
CMAKE_REQUIRED_LIBRARIES when… (authored by sdardis, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D43509?vs=135044&id=140930#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D43509

Files:
  libcxx/trunk/cmake/Modules/CheckLibcxxAtomic.cmake


Index: libcxx/trunk/cmake/Modules/CheckLibcxxAtomic.cmake
===================================================================
--- libcxx/trunk/cmake/Modules/CheckLibcxxAtomic.cmake
+++ libcxx/trunk/cmake/Modules/CheckLibcxxAtomic.cmake
@@ -31,7 +31,14 @@
   set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
 endfunction(check_cxx_atomics)
 
+# Perform the check for 64bit atomics without libatomic. It may have been
+# added to the required libraries during in the configuration of LLVM, which
+# would cause the check for CXX atomics without libatomic to incorrectly pass.
+set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "atomic")
 check_cxx_atomics(LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB)
+set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES})
+
 check_library_exists(atomic __atomic_fetch_add_8 "" LIBCXX_HAS_ATOMIC_LIB)
 # If not, check if the library exists, and atomics work with it.
 if(NOT LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB)


Index: libcxx/trunk/cmake/Modules/CheckLibcxxAtomic.cmake
===================================================================
--- libcxx/trunk/cmake/Modules/CheckLibcxxAtomic.cmake
+++ libcxx/trunk/cmake/Modules/CheckLibcxxAtomic.cmake
@@ -31,7 +31,14 @@
   set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
 endfunction(check_cxx_atomics)
 
+# Perform the check for 64bit atomics without libatomic. It may have been
+# added to the required libraries during in the configuration of LLVM, which
+# would cause the check for CXX atomics without libatomic to incorrectly pass.
+set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "atomic")
 check_cxx_atomics(LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB)
+set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES})
+
 check_library_exists(atomic __atomic_fetch_add_8 "" LIBCXX_HAS_ATOMIC_LIB)
 # If not, check if the library exists, and atomics work with it.
 if(NOT LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB)
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to