Skip to content
Snippets Groups Projects
Commit 206ab701 authored by Florian Schmaus's avatar Florian Schmaus
Browse files

[build] Check if std::atomic wait()/notify{_all}() is avaialble

Fixes builds on Debian stable, which currently fail with

ccache c++ -Ieval/io_latency.p -Ieval -I../eval -Iemper -I../emper -Iemper/io -I../emper/io -Iemper/include -I../emper/include -I/usr/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -Werror -std=c++2a -O2 -g -DBOOST_ALL_NO_LIB -pthread -isystem../subprojects/liburing-liburing-2.0/src/include -isystemsubprojects/liburing-liburing-2.0/src/include -MD -MQ eval/io_latency.p/IoLatency.cpp.o -MF eval/io_latency.p/IoLatency.cpp.o.d -o eval/io_latency.p/IoLatency.cpp.o -c ../eval/IoLatency.cpp../eval/IoLatency.cpp: In function ‘void watchFunc()’:
../eval/IoLatency.cpp:45:17: error: ‘struct std::atomic<bool>’ has no member named ‘wait’
   45 |   readSubmitted.wait(false, std::memory_order_acquire);
      |                 ^~~~
parent d6f21c60
No related branches found
No related tags found
No related merge requests found
......@@ -16,8 +16,25 @@ executable(
dependencies: emper_dep,
)
executable(
'io_latency',
'IoLatency.cpp',
dependencies: emper_dep,
std_atomic_wait_notify_code = '''\
#include <atomic>
int main() {
std::atomic<bool> atomic_bool;
atomic_bool.notify_one();
}
'''
cpp_has_std_atomic_wait_noitify = cpp_compiler.links(
std_atomic_wait_notify_code,
args: '--std=c++2a',
name: 'std_atomic_wait_notify',
)
if cpp_has_std_atomic_wait_noitify
executable(
'io_latency',
'IoLatency.cpp',
dependencies: emper_dep,
)
else
warning('C++ compiler does not support std::atomic wait()/notify()/notify_all(), not building io_latency binary')
endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment