cmake: check for 64-bit atomic operations directly

780bac671f did not actually successfully
compile on any platforms, leading to -latomic always being added
(including on platforms it does not exist on).

Work on #5865.
This commit is contained in:
David Adam 2019-12-20 23:47:46 +08:00
parent 780bac671f
commit 8f2f3b648f

View file

@ -191,10 +191,10 @@ FIND_PROGRAM(SED sed)
# https://github.com/fish-shell/fish-shell/issues/5865
CHECK_CXX_SOURCE_COMPILES("
#include <atomic>
struct big { int foo[64]; };
std::atomic<big> x;
#include <cstdint>
std::atomic<uint64_t> x;
int main() {
return x.load().foo[13];
return x;
}"
LIBATOMIC_NOT_NEEDED)
IF (NOT LIBATOMIC_NOT_NEEDED)