diff options
author | Michal Gorny <mgorny@gentoo.org> | 2019-01-03 16:43:27 +0000 |
---|---|---|
committer | Michal Gorny <mgorny@gentoo.org> | 2019-01-03 16:43:27 +0000 |
commit | c1d5999dd1e8e46fc5e72a9ace11f6b426c17850 (patch) | |
tree | 3625c2920dbf5efd1d58bd78a82891030302d9df /clang-tools-extra | |
parent | a3924b517e2d10c25ee3b41dfd96bb9a5333b64e (diff) |
[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
llvm-svn: 350329
Diffstat (limited to 'clang-tools-extra')
-rw-r--r-- | clang-tools-extra/clangd/CMakeLists.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt index 39467bd567eb..251ee7fc267e 100644 --- a/clang-tools-extra/clangd/CMakeLists.txt +++ b/clang-tools-extra/clangd/CMakeLists.txt @@ -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") |