[PATCH] D56061: [clang-tools-extra] [clangd] Fix detecting atomics in stand-alone builds
Michał Górny via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 23 12:04:26 PST 2018
mgorny created this revision.
mgorny added reviewers: bkramer, sdardis, sammccall, ilya-biryukov.
Herald added subscribers: kadircet, jfb, arphaman, jkorous, MaskRay, ioeric.
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
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D56061
Files:
clangd/CMakeLists.txt
Index: clangd/CMakeLists.txt
===================================================================
--- clangd/CMakeLists.txt
+++ clangd/CMakeLists.txt
@@ -2,6 +2,11 @@
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")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56061.179451.patch
Type: text/x-patch
Size: 415 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181223/36a3fe9b/attachment.bin>
More information about the cfe-commits
mailing list