From 7e6119c777fbe083c8ca7b31c79c76de12c5eb3c Mon Sep 17 00:00:00 2001 From: Niko Savola Date: Thu, 4 Jun 2026 10:30:27 +0000 Subject: [PATCH] Make TBB linking conditional and improve backward compatibility of execution header guards --- src/db/db/db.pro | 4 ++++ src/db/db/dbEdgeProcessor.cc | 17 +++++++++++------ src/db/db/dbPolygonTools.cc | 17 +++++++++++------ 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/db/db/db.pro b/src/db/db/db.pro index d316c1c60..1c1285342 100644 --- a/src/db/db/db.pro +++ b/src/db/db/db.pro @@ -454,3 +454,7 @@ INCLUDEPATH += $$TL_INC $$GSI_INC DEPENDPATH += $$TL_INC $$GSI_INC LIBS += -L$$DESTDIR -lklayout_tl -lklayout_gsi +packagesExist(tbb) { + LIBS += -ltbb +} + diff --git a/src/db/db/dbEdgeProcessor.cc b/src/db/db/dbEdgeProcessor.cc index 1b5a08391..a9f73666b 100644 --- a/src/db/db/dbEdgeProcessor.cc +++ b/src/db/db/dbEdgeProcessor.cc @@ -1,3 +1,14 @@ +#if __cplusplus >= 201703L + #if __has_include() + #include + #endif +#endif + +#if defined(__cpp_lib_execution) +#define PARALLEL_EXEC_POLICY std::execution::par, +#else +#define PARALLEL_EXEC_POLICY +#endif /* @@ -29,12 +40,6 @@ #include "tlProgress.h" #include "gsi.h" -#if defined(__cpp_lib_execution) -#include -#define PARALLEL_EXEC_POLICY std::execution::par, -#else -#define PARALLEL_EXEC_POLICY -#endif #include #include diff --git a/src/db/db/dbPolygonTools.cc b/src/db/db/dbPolygonTools.cc index 228a368bf..849e0a154 100644 --- a/src/db/db/dbPolygonTools.cc +++ b/src/db/db/dbPolygonTools.cc @@ -1,3 +1,14 @@ +#if __cplusplus >= 201703L + #if __has_include() + #include + #endif +#endif + +#if defined(__cpp_lib_execution) +#define PARALLEL_EXEC_POLICY std::execution::par, +#else +#define PARALLEL_EXEC_POLICY +#endif /* @@ -28,12 +39,6 @@ #include "tlLog.h" #include "tlInt128Support.h" -#if defined(__cpp_lib_execution) -#include -#define PARALLEL_EXEC_POLICY std::execution::par, -#else -#define PARALLEL_EXEC_POLICY -#endif #include #include