From 1b05c0c17c72ddf90190b9e8aa72c1f9b6d143c3 Mon Sep 17 00:00:00 2001 From: Thomas Helfer Date: Fri, 14 Nov 2025 14:07:08 +0100 Subject: [PATCH] Fix Issue #187 --- cmake/modules/clang.cmake | 5 ++++- cmake/modules/gcc.cmake | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/modules/clang.cmake b/cmake/modules/clang.cmake index ab45d7177..9544304e2 100644 --- a/cmake/modules/clang.cmake +++ b/cmake/modules/clang.cmake @@ -83,7 +83,10 @@ if(enable-parallel-stl-algorithms) # This is a poor test to check of libstc++ is used if(UNIX AND NOT APPLE) if(NOT enable-libcxx) - find_package(TBB REQUIRED) + find_package(TBB) + if(NOT TBB_FOUND) + message(FATAL_ERROR "Intel Threading Building Blocks library (TBB) is required by libstdc++ to support parallel STL algorithms. You may want to disable support for those parallel algorithms by passing -Denable-parallel-stl-algorithms=OFF to cmake") + endif(NOT TBB_FOUND) list(APPEND MGIS_REQUIRED_ADDITIONAL_PACKAGES "TBB") list(APPEND MGIS_ADDITIONAL_LIBRARIES "TBB::tbb") endif(NOT enable-libcxx) diff --git a/cmake/modules/gcc.cmake b/cmake/modules/gcc.cmake index 5cd104127..6a35f86d0 100644 --- a/cmake/modules/gcc.cmake +++ b/cmake/modules/gcc.cmake @@ -111,7 +111,10 @@ endif(enable-sanitize-options) set(COMPILER_C_WARNINGS "-Wall -W -pedantic") if(enable-parallel-stl-algorithms) - find_package(TBB REQUIRED) + find_package(TBB) + if(NOT TBB_FOUND) + message(FATAL_ERROR "Intel Threading Building Blocks library (TBB) is required by libstdc++ to support parallel STL algorithms. You may want to disable support for those parallel algorithms by passing -Denable-parallel-stl-algorithms=OFF to cmake") + endif(NOT TBB_FOUND) list(APPEND MGIS_REQUIRED_ADDITIONAL_PACKAGES "TBB") list(APPEND MGIS_ADDITIONAL_LIBRARIES "TBB::tbb") endif(enable-parallel-stl-algorithms)