cmake: improve dependency checks
[awesomized/libmemcached] / test / lib / Cluster.cpp
index 1589e68ccf6906f9f699b4924ba5e00289a0a937..37ec184e54d5f141ecd0c71b30b99e359d72f20d 100644 (file)
@@ -2,7 +2,7 @@
 #include "Retry.hpp"
 
 #include <algorithm>
-#if HAVE_EXECUTION
+#if HAVE_EXECUTION && HAVE_TBB
 #  include <execution>
 #endif
 #include <sys/wait.h>
@@ -56,7 +56,7 @@ void Cluster::stop(bool graceful) {
 
 bool Cluster::isStopped() {
   return none_of(
-#if HAVE_EXECUTION
+#if HAVE_EXECUTION && HAVE_TBB
     execution::par,
 #endif
       cluster.begin(), cluster.end(), [](Server &s) {
@@ -66,7 +66,7 @@ bool Cluster::isStopped() {
 
 bool Cluster::isListening() const {
   return all_of(
-#if HAVE_EXECUTION
+#if HAVE_EXECUTION && HAVE_TBB
     execution::par,
 #endif
       cluster.begin(), cluster.end(), [](const Server &s) {
@@ -79,7 +79,7 @@ bool Cluster::ensureListening() {
     return false;
   }
   auto listening = all_of(
-#if HAVE_EXECUTION
+#if HAVE_EXECUTION && HAVE_TBB
     execution::par,
 #endif
   cluster.begin(), cluster.end(), [](Server &s) {