diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index 2c2f0532a89d0..c64ab05414e21 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -1240,8 +1240,10 @@ if(imt AND NOT builtin_tbb) endif() endif() - # Check that the found TBB does not use captured exceptions. - if(TBB_FOUND) + # Check that the found TBB does not use captured exceptions. If the header + # does not exist, assume that we have oneTBB newer than + # version 2021, which does not have captured exceptions anyway. + if(TBB_FOUND AND EXISTS "${TBB_INCLUDE_DIRS}/tbb/tbb_config.h") set(CMAKE_REQUIRED_INCLUDES "${TBB_INCLUDE_DIRS}") check_cxx_source_compiles(" #include diff --git a/core/imt/src/RTaskArena.cxx b/core/imt/src/RTaskArena.cxx index 7cec618cbb29a..342eba61a4d32 100644 --- a/core/imt/src/RTaskArena.cxx +++ b/core/imt/src/RTaskArena.cxx @@ -1,6 +1,5 @@ // Require TBB without captured exceptions #define TBB_USE_CAPTURED_EXCEPTION 0 -#include "tbb/tbb_config.h" #include "ROOT/RTaskArena.hxx" #include "ROpaqueTaskArena.hxx" diff --git a/core/imt/src/TThreadExecutor.cxx b/core/imt/src/TThreadExecutor.cxx index 98b8135903906..1458502b0aa5b 100644 --- a/core/imt/src/TThreadExecutor.cxx +++ b/core/imt/src/TThreadExecutor.cxx @@ -1,6 +1,5 @@ // Require TBB without captured exceptions #define TBB_USE_CAPTURED_EXCEPTION 0 -#include "tbb/tbb_config.h" #include "ROOT/TThreadExecutor.hxx" #include "ROpaqueTaskArena.hxx"