[clang-tools-extra] r350329 - [clangd] Fix detecting atomics in stand-alone builds

Michal Gorny via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 3 08:43:27 PST 2019


Author: mgorny
Date: Thu Jan  3 08:43:27 2019
New Revision: 350329

URL: http://llvm.org/viewvc/llvm-project?rev=350329&view=rev
Log:
[clangd] Fix detecting atomics in stand-alone builds

Include CheckAtomic CMake module from LLVM in order to detect support
for atomics when building stand-alone.  Otherwise,
the HAVE_CXX_ATOMICS64_WITHOUT_LIB variable is undefined and clangd
wrongly attempts to link -latomic on systems not using the library.

Original bug report: https://bugs.gentoo.org/667016

Differential Revision: https://reviews.llvm.org/D56061

Modified:
    clang-tools-extra/trunk/clangd/CMakeLists.txt

Modified: clang-tools-extra/trunk/clangd/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/CMakeLists.txt?rev=350329&r1=350328&r2=350329&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/CMakeLists.txt (original)
+++ clang-tools-extra/trunk/clangd/CMakeLists.txt Thu Jan  3 08:43:27 2019
@@ -2,6 +2,11 @@ set(LLVM_LINK_COMPONENTS
   Support
   )
 
+if(CLANG_BUILT_STANDALONE)
+  # needed to get HAVE_CXX_ATOMICS64_WITHOUT_LIB defined
+  include(CheckAtomic)
+endif()
+
 set(CLANGD_ATOMIC_LIB "")
 if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
   list(APPEND CLANGD_ATOMIC_LIB "atomic")




More information about the cfe-commits mailing list